[self-interest] documentation!
David Ungar
ungar at me.com
Sun Jul 24 21:25:15 UTC 2016
Great examples. But you omitted the source code.
Here are some:
in traits collection:
addAll: c = ( c do: [ |:v. :k| add: v WithKey: k ]. self)
c is anything that responds to ‘do:', and the collection gets each element of c added to it. That’s what I would expect one could get from reading this code.
What responds to ‘do:’? Use implementors. You get lots of implementors, telling you that many things are possible for c, including:
sets, dictionaries, collections, lists, etc.
What does ‘do:’ do? That’s where a knowledge of Smalltalk would be helpful.
But you could run this:
'abc' do: [|:x| x printLine] and see what happens.
Perfect? Far from it. But there are techniques and ways of thinking that are different from what most people are used to.
3 do: [|:x| x printLine]
will work. More things tend to work with more things than in most other systems.
> On Jul 24, 2016, at 12:13 PM, Bystroushaak bystrousak at kitakitsune.org [self-interest] <self-interest at yahoogroups.com> wrote:
>
> addAll: c
>
> - character? characters? copy? content?
>
> mul: m Into: r
>
> - r? I have no idea.
>
> fillFrom: c
> fillWith: v
> interpolate: p From: v
>
> - I really have no idea what the parameters is and what type.
>
> printStringSize: s
>
> - The s is for string, or size?
>
> remove: x
>
> - Is x the index or the character which should be removed?
> - Is it character or multicharacter string?
>
> includes: v
>
> - Again v is probably value, but it is character, or string?
> (Now I know that there is includesAll: c, but that is half the
> page down hidden in the category.)
>
>
> Dne 24.7.2016 v 18:07 David Ungar ungar at me.com [self-interest] napsal(a):
>> Fun discussion! Would you like to name a particular method in traits
>> string? I am curious about exactly what was confusing. I can think of
>> possibilities, but am likely to just guess wrong.
>>
>> Thanks,
>>
>> - David
>>
>
>
>
> ------------------------------------
>
> ------------------------------------
>
>
> ------------------------------------
>
> Yahoo Groups Links
>
>
>
More information about the Self-interest
mailing list