empirical-lang
empirical-lang copied to clipboard
Function parameters are only being taken as reference
Found by @bobjansen:
func foo(x: Int64):
x = x - 1
return
end
let a = 7
print(a)
foo(a)
print(a)
This prints:
7
6
The parameter is being taken as a reference rather than a copy. This is related to the much bigger issue of copy-on-write requirements for memory management, as cryptically mentioned in the roadmap (#1).