Koka-inspired local mutable variables for cleaner comprehensions

The problem with this approach is that you are effectively introducing mutability and, without compiler guarantees, it can easily escape the context of a function. I’d say it is very important to avoid that and keep the reassignment local. The mutability should not be observable at runtime, not even via introspection.

They can, but they only return the last value. The mutability itself is restricted to the function.

Sure, we can discuss syntax later. Focusing on the ideas and semantics is more important for now.

3 Likes