OÄuz <oguzismailuy...@gmail.com> writes: >> It's a violation of scope. > > It's a violation of lexical scope, I'm asking why not implement > dynamic scope, what's wrong with it?
Yes ... but the history of programming languages has been the history of learning that dynamic scoping is dangerous to program and lexical scoping is the Right Thing. >> Can you name *any* other language where functions can break out of their >> caller's loops? The only thing that comes to mind for me is C's "longjmp", >> which I've never used even once. (Not that I do any C programming these >> days, but back in the 1990s, I did.) The way to think about longjmp is that it's a goto that wrenches you out of nested contexts, somewhat like calling a completion in Scheme. But if you're using it sanely, it's clear what location the longjmp takes you to, whereas a dynamically-scoped break is not. Dale