lua-users home
lua-l archive

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


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

On 17/01/2014 16:19, Andrew Starks wrote:
> 
> Seems like it would be nicer if assert respected __tostring, as
> error does. Whenever I think this, someone explains a great answer
> for it. In three, two, one...

Technically speaking, error() does not respect __tostring - that is
the job of debug.traceback (or whatever replacement handler you set
with xpcall.)
error() does not care what the error object is.  It just passes it the
the handler unchanged, then returns the result of that to whoever
called pcall/xpcall.  I agree though - it would be preferable if
assert() did the same thing.

Finn
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.18 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJS2VpAAAoJEHp3pOlF38H/aF8H/21JUn+o1Ck13tOFyXC4aWH9
1j2rVB0+4PB31qDw7GAfud9sAM4qA4wG6zPFWUK17n67mX26iKjRAUnMDvbqlLZ0
G18YV24OWZVw02st1ErGah2AGgv+SvKR5boV4D2MRyrhpzYCZRH2BNjCDxtnLMB5
1feynHC9M02OHbfhAoUZhZA6pioTBdC83lD8q7E+Pd+tzKPwD+OeX4q968WsiQ82
pBcPKxVEqg8iVd/7vslUsmUtwCIkMWpKJ6FoYq4ltOzqIFkqflgIv8rbGTAqyHa2
sdTyicqBEVt6QUdHlgtKR8PeMde4bOMJyDoMY1OdguXt2gzo8yjuu+lmVSdi1fc=
=N5rc
-----END PGP SIGNATURE-----