[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Custom messages
- From: Dirk Laurie <dpl@...>
- Date: Wed, 16 Feb 2011 14:03:58 +0200
On Wed, Feb 16, 2011 at 01:24:57PM +0200, Julien Duminil wrote:
>
> Maybe we could add an error/custom message to every nil variable.
> Plus, add of a function reason(nil_var) that give the message.
>
This idea is much more generally applicable.
One non-invasive implementation could be a library function:
debug.setmessage(t)
If you never call this routine, you've got standard Lua. Otherwise,
you can use it to deprecate features to your heart's content.
debug.setmessage{condition='assign_nil',severity='error'}
debug.setmessage{condition='implicit_conversion',severity='warn'}
It could also be used to make Lua talk non-English.
Dirk