of course, I don't want it to be a requirement, an...
# language-proposals
k
of course, I don't want it to be a requirement, and I would argue that the current behavior should be maintained as the default. I just think it would be nice if you could specify that a lambda should be pure, or take a certain number of arguments. The proposed syntax from Jai seems kind of nice to me as a wishlist item:
{ /* non-pure function, can access variables outside the closure */ }
[foo, bar] { /* non-pure function, but compiler will emit an error if you try to use any variable besides foo and bar */ }
[] { /* pure function, cannot access any outside vars */ }