bystrousak at kitakitsune.org
Sun Jul 24 21:30:47 UTC 2016
Ah. I've been able to find out on my own, there is no problem here. It
is just that it would be more effective, if I could use methods just
from the signature of their header. This kind of forces me to read the
whole source code, which is time consuming.
Many times I know exactly what I want, I just don't know where it is in
Self and what the name is.
Dne 24.7.2016 v 23:25 David Ungar ungar at me.com [self-interest] napsal(a):
> 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.
More information about the Self-interest