[self-interest] A few questions from a smalltalker
dave at nexttolast.com
Tue Oct 25 15:10:49 UTC 2011
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.
> * 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.
> * 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.
Selfers just GetIt (tm)
Hope this helps.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Self-interest