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