[self-interest] documentation!

David Ungar ungar at me.com
Sun Jul 24 21:45:56 UTC 2016


I’m not sure you get it: there is no signature, no such concept in Self. That’s part of what I’m trying to say. It’s a different model of computation.

The concepts are more like natural language concepts. If a thing wants to pretend it’s like a collection, it will implement do:. It may only partially pretend and not implement all of collectionness. But that may be fine for a particular use case.


> On Jul 24, 2016, at 2:30 PM, Bystroushaak bystrousak at kitakitsune.org [self-interest] <self-interest at yahoogroups.com> wrote:
> 
> 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.
> 
> 
> 
> ------------------------------------
> 
> ------------------------------------
> 
> 
> ------------------------------------
> 
> Yahoo Groups Links
> 
> 
> 




More information about the Self-interest mailing list