lua-users home
lua-l archive

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


I was wondering whether it's problematic to use 'error' function as an exception mechanism? The language shootout had an entry for this and, apparently, both Lua versions used 'error' function as a model for exceptions.  I have explored the mailing list archive and have some idea of what to expect. But if you are toying with the same idea why not discuss it.

1. Are there any common platforms that would have hard time with setjmp/longjmp C functions and thus with Lua error function in general. How about game consoles? PDAs?
2. Does calling 'error' impair garbage collection in any way? That is, if I had some user data referenced in a function that calls error would such user data be collected properly?
3. If you have used 'error' for exceptions, what are you impressions? What worked, what didn't?

Thanks,
AB