Scripting syntax: all expressions or declarations?

Klaus D. Witzel klaus.witzel at cobss.com
Wed Aug 23 11:32:56 UTC 2006


On Wed, 23 Aug 2006 12:46:38 +0200, Damien Pollet wrote:

> Hi,
>
> We were discussing options to adapt the smalltalk syntax to write code
> in files. The main problem is that methods in smalltalk are parsed
> separately, and the method patterns won't fit if we are to put several
> method declarations in a single file.
>
> - Stef prefers a dedicated declarative syntax (like the one of Pepsi,
> and that would indeed be nice to be compatible and not invent yet
> another nearly identical syntax)
> - I'm more fond of an "everything is an expression" syntax, so a
> source file would just be a big doIt in regular syntax with messages
> like #subclass:instanceVariables: or #>> and probably a extended block
> syntax to give them selectors.

For mee too (everything is an expression, big doIt in regular sytnax). I'm  
toying with Self's slot declaration syntax (as an addition to the regular  
Smalltalk syntax), like in

an anonymous class is declared ( | instVar1. ... | )

a method is declared ( | instVar1. selector = ... | )

a method with arguments is then ( | ... keyword: arg = ... | )

And similiar for blocks. Very light, very easy, just add a pair of  
parentheses around regular Smalltalk syntax.

/Klaus

> Do you know any discussions about this part of language design? I like
> the all-expression way because it feels more interactive, but we will
> probably need to abuse the smalltalk syntax to make it really
> practical/concise...
>





More information about the Squeak-dev mailing list