asoffer / Icarus

An experimental general-purpose programming language
Apache License 2.0
9 stars 2 forks source link

Assignments to out of scope variables could have better error messages. #30

Closed asoffer closed 3 years ago

asoffer commented 3 years ago

This should produce an error but does not.

i := 0
f ::= () -> () { i = 1 }
asoffer commented 3 years ago

Changing this to an enhancement now that there is an error message (just not a great one).

perimosocordiae commented 3 years ago

What's the syntax for capturing a local variable?

asoffer commented 3 years ago

No such syntax exists. I'd like a syntax for capturing but I think we first need a solution for lifetime tracking. Or at least start captures with by-value only. If you're interested, feel free to open an issue as a proposal for syntax and semantics.