[self-interest] Re: Announcing mySelf
Stefan Matthias Aust
sma at kiel.netsurf.de
Wed Jan 6 18:49:06 UTC 1999
>About expressions in parentheses, in Self 1.0 they WERE parsed as
>method objects, though they were tagged as "inner methods" as
>opposed to the normal "outer methods".
Then SELF 1.0 had no '( expr )' at all. Everything in () was a new object,
however only objects in slot definitions got a 'self' slot. Right?
>This was eliminated in Self 2.0 or 3.0, and I patched my tinySelf0
>parser (in C) to handle this by testing for inner methods that
>had exactly one expression and no slots and "expanding" them so
>that the following bytecodes would now be generated:
Which is the same heuristic as I used. However, I dislike this solution
because I'd prefer one which can be expressed with a context free LL(1)
>then tinySelf0 will generate an inner method, but Self 4.0 will
>complain that inner methods are no longer supported.
But this means, the grammar given in the Self 4.0 programmers reference is
wrong (or at least ambigious). If I understand this correctly, objects
with code (aka methods) are only allowed in constant slot definition and
never in general expressions. This would lead to...
object --> '(' [object-slot-list] ')'
method --> '(' [object-slot-list] code ')'
block --> '[' [block-slot-list] [code] ']'
(btw, whats the result of the empty block ?)
receiever --> [primary]
primary --> 'self' | '(' expression ')' | constant
constant --> number | string | object | block
expression --> keyword-message
and so on... (see my web site for a full grammar)
unary-slot --> identifier ['*'] '=' method
binary-slot --> operator [identifier] '=' method
keyword-slot --> ... '=' method
data-slot --> identifier ['*'] [('<-' | '=') expression]
and there's now only a problem to distinguish a constant data-slot and an
unary-slot. (| a = (3 + 4). |) would actually be a method, not a constant.
>I have downloaded two very interesting programs. Here are the first
>lines of the README files for them:
I'd be interested in the Ultimardrev-Self thing, and might even try to port
this to VW3 or Squeak, which might be easier.
Stefan Matthias Aust // Are you ready to discover the twilight zone?
eGroup home: http://www.eGroups.com/list/self-interest
Free Web-based e-mail groups by eGroups.com
More information about the Self-interest