lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mark Hamburg wrote:
[...]
> The Scheme answer is that you get to return again from handleClicksOn.

What does that do? The closure's already has a dynamic chain (it's been called
from somewhere). If you return to the original method, don't you end up
abandoning that entire dynamic chain and cloning the one you had originally
when the closure was created? Which, presumably, has all kinds of stale state
and will do generally unuseful things...

[...]
> I think the Dylan answer is that it's an error and Dylan presumably throws
> an exception. Yes, you can argue that it isn't the fault of the call chain
> that led to the block being called and trying to return, but to the extent
> that an exception means "someone tried to do something they shouldn't" --
> e.g., index a number -- this is an appropriate use for exceptions.

That's true; however, this particularly exception is of the kind that is
metaphorically subclassed from ProgrammerScrewedUpException, which shouldn't
really happen. I can't really see much that it's possible to do usefully at
this stage --- since the programmer's screwed up, you don't even know that
your application's internal state is viable any more, so even doing something
like saving the document and shutting down is questionable.

(Although if your application was database-oriented, then abandoning the
current transaction and terminated would be entirely viable. Hmm.)

- --
┌── dg@cowlark.com ─── http://www.cowlark.com ───────────────────
│
│ "There does not now, nor will there ever, exist a programming language in
│ which it is the least bit hard to write bad programs." --- Flon's Axiom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGy3o2f9E0noFvlzgRAueMAKCIP5lVG2QV1cBdoA56nvv8Or1RTACfbSxA
3njmDbbA12shpXLirAfLSwg=
=ZHYq
-----END PGP SIGNATURE-----