Re:The Bagel Language
by kybernetikos on Tuesday September 21, 2021 @07:24AM
(#28603932)
Changing mutable state you've closed over is a side effect, so from your description I assumed that wouldn't be allowed in a function.
Or are you talking about reading mutable state you've closed over where you're still a pure function (just with hidden arguments) but the environment might change and you can't send that over the wire.
That's what I mean. Functions can't mutate anything, period- the assignment operator won't even parse, and calls to procedures are forbidden. But they can still close over state that is mutable one other contexts
The full implications of allowing this in closures have yet to be explored and I still need to make sure they won't break the guarantees I'm wanting to offer
This isn't really true, since they'll still capture their closures and will definitely be able to reference other constructs like classes, etc