[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lightweight syntax: a dissident view
- From: Robert Raschke <rtrlists@...>
- Date: Thu, 25 Nov 2010 18:26:03 +0000
We need more fire :-)
Inspired by Smalltalk (http://web.cecs.pdx.edu/~black/OOP/Tutorial/SqueakLanguageRef.html, Block Expressions):
[ statementSequence ] "block without arguments"
[ (: identifier)+ | statementSequence ] "block with arguments"
[ x=1 y=2 return x+y ] "a block which, when evaluated, will answer the value 3"
[ object:doWithSideEffects(); return test] "a block which, when evaluated, will send #doWithSideEffects to object, and answer the object test"
[ :param | return param:doSomething() ] "a block which, when evaluated with a parameter, will answer the result of sending #doSomething to the parameter.
Obviously, leaving away a return, means no return value from the block.
Potentially extensible to include (ducking now :-):
[ (: identifier)+ | | identifier+ | statementSequence ] "block with arguments and local variables"
Robby
- References:
- Re: Re: Re: Lightweight syntax: a dissident view, Gunnar Zötl
- Re: Re: Re: Lightweight syntax: a dissident view, Luis Carvalho
- Re: Re: Re: Lightweight syntax: a dissident view, Axel Kittenberger
- Re: Re: Re: Lightweight syntax: a dissident view, Pierre-Yves Gérardy
- Re: Re: Re: Lightweight syntax: a dissident view, Roberto Ierusalimschy
- Re: Re: Re: Lightweight syntax: a dissident view, Mateusz Czaplinski
- Re: Re: Re: Lightweight syntax: a dissident view, Axel Kittenberger
- Re: Lightweight syntax: a dissident view, Philippe Lhoste
- Re: Lightweight syntax: a dissident view, Pierre-Yves Gérardy
- Re: Lightweight syntax: a dissident view, steve donovan
- Re: Lightweight syntax: a dissident view, Paul Hudson
- Re: Lightweight syntax: a dissident view, Mark Hamburg
- Re: Lightweight syntax: a dissident view, Mark Hamburg