aboutsummaryrefslogtreecommitdiffstats
path: root/core/value.moon
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-03-18 17:50:33 +0000
committers-ol <s-ol@users.noreply.github.com>2020-03-18 18:03:04 +0000
commita49382c7b46c7bdf1c105c0783c7bdcd0bb70e4a (patch)
treec1f800736e1905514aa913630ee31a720e770c9e /core/value.moon
parentdocs/internal: add builtins and invoke modules (diff)
downloadalive-a49382c7b46c7bdf1c105c0783c7bdcd0bb70e4a.tar.gz
alive-a49382c7b46c7bdf1c105c0783c7bdcd0bb70e4a.zip
fork ops before eval cycle
Diffstat (limited to 'core/value.moon')
-rw-r--r--core/value.moon9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/value.moon b/core/value.moon
index 0f40ef3..bda6127 100644
--- a/core/value.moon
+++ b/core/value.moon
@@ -36,6 +36,15 @@ class Value
assert type == @type, msg or "#{@} is not a #{type}" if type
@value
+ --- create a mutable copy of this Value.
+ --
+ -- Used to wrap insulate eval-cycles from each other.
+ --
+ -- @treturn Value
+ fork: =>
+ with Value @type, @value, @raw
+ .updated = @updated
+
--- alias for `unwrap`.
__call: (...) => @unwrap ...