[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: settor functions
| > But the following is magic, and exits after one iteration:
| > fn borg { while {sleep 1} $1 }
| > borg { echo 'new operating system Deep-Space-9'; return; }
|
| i would call that incorrect but legal. it might do what you want,
| but i would not want to write the language spec (if such a thing
| was to be written) to require it.
Just to clarify, I want it not to do that. :-)
| anyway, for now, return (and the rest of the exception mechanism) is strictly
| dynamic. if and when we add first class continuations, we can start thinking
| about lexically scoping things like return.
Actually, with fluid-let it can be dynamically scoped. Exception
handling in scheme (such as it is) pretty much needs to do it that
way. So you could implement the behaviour you want using existing
mechanisms (which have clean semantics). I think your intuition is
good; it's the current implementation that I'm nervous about.