unison/unison-src/transcripts/scope-ref.md
2024-06-25 11:11:07 -07:00

273 B

A short script to test mutable references with local scope.

scratch/main> builtins.merge
test = Scope.run 'let
  r = Scope.ref 0
  Ref.write r 1
  i = Ref.read r
  Ref.write r 2
  j = Ref.read r
  Ref.write r 5
  (i, j, Ref.read r)

> test