hpi-swa / vivide

A Squeak/Smalltalk-based programming environment and framework that supports low-effort construction of graphical tools by employing a data-driven perspective and a script-based programming model.
MIT License
58 stars 9 forks source link

Configure bindings in script properties #297

Open marceltaeumel opened 5 years ago

marceltaeumel commented 5 years ago

The user might want to keep state across script (or block) executions. Script properties might be a good place to configure such (persistent) bindings:

{
   [:num |
      counter := (counter ifNil: [0]) + 1.
      num * num] -> { #bindings -> #(counter) }
} asScript.

Maybe also store the initialization value in those configurations:

{
   [:num |
      counter := counter + 1.
      num * num] -> { #bindings -> { #counter -> 0 } }
} asScript.