[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

some suggestions




Hello,

I have a few comments/suggestions - the result of struggling to write a 
grammar for Self. It seems a shame to introduce inconsistencies because
of some seemingly arbitrary decisions about syntax.

'=' :

You cant define '=' for the lobby (or anything that the lobby inherits from 
- eg default behavior). If you try - Self crashes - stack overflow or something
like that.
This makes it somewhat tricky to define the necessary methods in defaultBehavior
so that everything that inherits from the lobby can be added to a set 
(for example), which is somewhat annoying.
I realise that the lobby having '=' defined for it would lead to some strange 
looking expressions being quite legal. For example: 
'm = ( | f = = 10. t = = self | something )'
would result in the local slots f and t having the values true and false
respectively. Or 't = = self' would result in a read only slot t = true.
How about using something different to '=' for the things that 
__arent_the_same__ as a message send '='?

'.' :

'.' is used for different things - how about using something else
for the end of a statement - eg ';' and/or something different for delegation,
eg. '~'

'^' and '|'

'^' and '|' have special meanings so they cant be used as operator names,
but '^^' and '||' can (but try to define a method '^^ x = ( x )' and you
get an error - whereas '^ ^^ x = ( x )' is OK.

Ivan.

PS - really this isnt just to make it easier for me to write a grammar -
its a matter of consistency in all things.