lua-users home
lua-l archive

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


It was thus said that the Great nobody once stated:
> If there's stuff that may temporarily fail and your code is structured
> as coroutines, add a handler that yields and eventually (on resume)
> retries? (A library writer can do an immediate retry, but they can't (or
> shouldn't) delay (single-threaded code!) for longer, can't really assume
> coroutines, can't... do anything to fix it, really. But you know your
> environment, know stuff that the library writer can't assume – and that
> may add a bunch of options for dealing with problems... Recall how I
> said that normal exceptions are "closed" and this is "open"? See the
> difference?)
> 
> Does this approach have a common name?

  Lisp calls them "conditions".  

  MS-DOS used this concept and allowed a program to install a "critical
error handler"---the default one provided by MS-DOS printed out

	Not ready error reading drive A
	Abort, Retry, Ignore, Fail?

and the user could hit A, R, I or F.

> Has anyone else tried this /
> knows a place where this was used? Particularly on larger code bases:
> Does it keep working... or will it go up in flames? (I haven't seen this
> elsewhere yet, tried this a bunch of times on smaller experiments... It
> worked fine, but it looks like getting the balance on the structure of
> expectations right (over-/"under-engineering") will be tricky for larger
> stuff.)

  I did something like this for C.  It was a pain to use and I gave it up.

  -spc (It's easier to manage in Lisp because of the macro system)