[self-interest] Grammar changes - comments?

Stefan Matthias Aust sma at netsurf.de
Sun Aug 29 13:44:38 UTC 1999


Hi!

For mySelf, I want to slightly change the Self grammar as follows...

expression 	= keywordMessage.
keywordMessage= binaryMessage {keywordSend} | resend keywordSend.
keywordSend 	= smallKeyword keywordMessage {capKeyword keywordMessage}.
binaryMessage = unaryMessage {binarySend} | resend binarySend.
binarySend 	= operator unaryMessage.
unaryMessage 	= receiver {unarySend} | resend unarySend.
unarySend 	= identifier.
[...]
resend 	= [identifier] '$'.

In contrast to Self, I use '$' to define delegation. Instead of "resend.x"
you'd write "$x" now which is similiar to implicit self sends.  What do you
all think about this?

It's much easier to parse and removes the special treatment of the "."
which had to be followed by no whitespace.  While you'd typically use no
whitespaces with "$", you could do this if you want.


Furthermore, I'm thinking about adding the ";" cascade operator from
Smalltalk to mySelf.  I'm pretty new to actually code in Self, but 

  newPair: key Value: value = (
    | pair |
    pair: (| parent* = defaultBehavior. key. value |) clone.
    pair key: key. pair value: value.
    pair
  )
     
looks ugly IMHO. I'd prefer

  newPair: key Value: value = (
    | pair = (| parent* = defaultBehavior. key. value |) |
    pair clone key: key; value: value
  )

Comments?


bye
--
Stefan Matthias Aust  //  Bevor wir fallen, fallen wir lieber auf.



More information about the Self-interest mailing list