Tensegritics / ClojureDart

Clojure dialect for Flutter and Dart
1.44k stars 91 forks source link

Use Zones to implement dynamic bindings #205

Closed cgrand closed 1 year ago

cgrand commented 1 year ago

Somehow we missed Zone when implementing dynamic vars. We should reimplement them on top of this.

cgrand commented 1 year ago

Relevant tweet to make it work nicely with stack traces https://twitter.com/mraleph/status/1654127638938804227?s=61&t=QqjbG61Ee_JhXPKw2RXR8w

cgrand commented 1 year ago

Note to self: if we turn binding forms in runZoned we must take care of putting an await in front of runZoned when the thunk is async.

cgrand commented 1 year ago

as the values map in Zone, we put namespaced symbols and as values volatiles. Then we change get-dynamic-binding and set-dynamic-binding! to use zone