sible and rewrite-friendly software → More resilient society.
about summary refs log tree commit diff stats
path: root/400.mu
blob: 93e6f03a69ef9c729aedf7f2942719c5b7d98e9a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19<
# compare mutable.mu

def main [
  local-scope
  x:&:num <- new number:type
  foo x
]

def foo x:&:num [
  local-scope
  load-inputs
  *x <- copy 34  # will cause an error because x is immutable in this function
]