Hi,
I’ve come across the notion of a “closed” function.
As far as I understand it it is a “pure” function that only depends on it’s arguments and does not refer to any “outer” variables from an environment.
While I can see that from an implementation point of view there is probably some optimization to be gained when you don’t need to keep track of an environment, however I cannot see why you need the special syntax “#{…}” for that…
Should the compiler/interpreter not be clever enough to figure out that a function does not refer to any environment and provide some optimization without having to tell him explicitly?
As far as I understand it marking a funktion as “closed” does not do anything, apart from (probably) some optimization on the implementation level and that could be figured out without the user/programmer having to explicitly mark a function as “closed”…
What am I missing/not understanding?
Many thanks!