Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
aBlock value
Last updated at 3:08 pm UTC on 7 May 2019
If the message #value is sent to a code Block it is is evaluated.

 [3 + 4] value
is
 7

whereas

 [3 + 4] printString
gives
 [3 + 4]  [closure] in UndefinedObject>>DoIt
in a recent version of Squeak.



 block := [MorphicProject openViewOn: nil]. "nil means a new project has to be created"
 block value
opens a new ProjectViewMorph object.

Another example: A block as the target of a SimpleButtonMorph

tagBeginner