Quoting constructs: Difference between revisions
Content added Content deleted
(→Blocks) |
(→Blocks) |
||
Line 452: | Line 452: | ||
^ nil "I am false, so I ignore the block"</lang> |
^ nil "I am false, so I ignore the block"</lang> |
||
Thus, the expression "someBoolean ifTrue:[ 'hello print' ]" will either evaluate the lambda or not, depending on the someBoolean receiver. |
Thus, the expression "someBoolean ifTrue:[ 'hello print' ]" will either evaluate the lambda or not, depending on the someBoolean receiver. |
||
Obviously, you can teach other objects on how to respond to "value" messages and then use them as if they where blocks. |
|||
In addition, some Smalltalk dialects implement additional syntax extensions. |
In addition, some Smalltalk dialects implement additional syntax extensions. |