lua-users home
lua-l archive

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


As a relevant sampling point (especially since C++ exceptions have been
mentioned), in my work we do lots of embedded programming, PC programming,
and Windows CE programming.  In all of that (using probably a sampling of
~5-8 embedded C compilers) we have never seen setjmp/longjmp NOT be
implemented by the compiler vendor.  However, Windows CE (and the associated
Embedded Visual Tools) does not support C++ exceptions (and C++ compilers
for embedded uCs/platforms are still fairly rare even though they are
starting to catch on).

-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br]On Behalf Of Bilyk, Alex
Sent: Thursday, December 18, 2003 12:10 PM
To: Lua list
Subject: error, setjmp and exceptions


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

<<attachment: winmail.dat>>