[self-interest] A few questions from a smalltalker
ungar at me.com
Tue Oct 25 18:23:02 UTC 2011
- David (from iPad, typos likely)
On Oct 25, 2011, at 8:10 AM, David Goehrig <dave at nexttolast.com> wrote:
> On Oct 25, 2011, at 3:45 AM, Bernat Romagosa <tibabenfortlapalanca at gmail.com> wrote:
>> * Where is the Class Browser?
>> I know this must make no sense in Self as there are no Classes to browse, but then: how do you explore the system library? How do you know which objects are there to copy and what can they do?
> Bring up a shell, type lobby in it, and then Get It!
> Lobby is the entry point to the world, sort of like the Smalltalk object itself, and it containts references to all traits, prototypes, and globals. Applications and utilities as well as core system objects can be found there too.
If you type 'globals' into a shell and do a get-it, you will get the object that is most like the Smalltalk system dictionary.
>> * How does one create an object?
>> I'm not sure if "create" is the right word to use. I mean it the same way one would say "instantiate a class" in Smalltalk. I guess if Self has no classes, what you actually do is to "copy" existing objects and modify them, is that right?
> Either copy an existing or create an empty slots object by typing:
> And hitting get it. This will give you an inspector you can add slots to.
Typically, find an object you like, and then send id 'copy' or 'copyRemoveAll' for a collection.
Example: 'list copyRemoveAll'
>> * Can you print stuff?
>> I noticed that shells can both DoIt and GetIt stuff, but not PrintIt. Does this respond to some design principle?
> You can print by getting the string of something but it isn't as common an idiom as you can get a manipulable reference to the object itself just as easily. You can always ask an object for it's symbolic form, but it needs the behavior to return that. Since there is no base Object class, there is no guarantee suck a method exists.
Yes. You can send printString or print to many objects.
> Selfers just GetIt (tm)
> Hope this helps.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Self-interest