[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

test[misc] deferred execution

| done printed action times |
done := printed := false.
times := 10.
action := [
  self print: '// executing action #' ,times printString.
  times := times - 1.
  done := true. printed := false.
  self print: 'times=',times.
  times > 0
    ifTrue: [ action valueDeferred: 300 ]
    ifFalse: [ self print: '// deferred execution test complete.' ]
].
action valueDeferred: 300.