mu/archive/1.vm/immutable-error.mu

14 lines
214 B
Forth
Raw Normal View History

# compare mutable.mu
def main [
local-scope
2016-09-17 19:55:10 +00:00
x:&:num <- new number:type
foo x
]
2016-09-17 19:55:10 +00:00
def foo x:&:num [
local-scope
2017-12-04 07:25:40 +00:00
load-inputs
*x <- copy 34 # will cause an error because x is immutable in this function
]