[self-interest] Two simple Self questions and one Self design philosophy query
lattam at mac.com
Wed Jun 16 21:44:47 UTC 2004
I am not sure of the first and third questions, but I can answer the
Initialization expressions (like traits clonable) are by definition
evaluated in the context of "lobby" which does know what traits means.
Your example also shows why this rule is there rather than evaluating
the expression in the context of the new object (which is stone dumb at
On Jun 16, 2004, at 11:59 AM, Ben Moseley wrote:
> (Apologies if these are somewhat naive - I'm very new to the Self
> world, but intrigued...)
> The first simple question is - suppose I have an object representing a
> table which has four slots to four other objects representing its
> legs. If I send a "copy" message to this I will by default get a new
> table which shares the legs of the old one (ie - it is a shallow copy).
> What is the standard Self idiom for achieving the desired affect? Is it
> to implement a custom "copy" method?
> The second simple question: Why does "parent* = traits clonable" work
> on a new - empty - object when initially "traits" can't be found. (By
> this I mean if I have a parent-less object and type "traits" or "traits
> clonable" into its evaluator, I get a debugger). There is obviously
> some boot-strapping going on here - ie the "traits clonable" which is
> used for the parent slot assignment is being evaluated in a different
> environment (one which has access to the lobby?) - I was just wondering
> how it worked.
> Finally, Self makes a clear distinction between prototypes which are
> copied (but not inherited from) and traits objects which can be used
> for inheritance whereas some other prototype languages merge the two
> concepts (ie they inherit via their prototypes by default). I know one
> of the original reasons given for the Self approach was to ensure that
> the prototype object was genuinely a prototype of objects cloned from
> it and not special in any way, but I am curious if with hindsight this
> is viewed to be a strength or a weakness of Self. (If this has been
> discussed elsewhere I'd be very grateful for pointers).
> Thanks very much,
> Yahoo! Groups Links
More information about the Self-interest