On 13/06/2011 21.52, Roberto Ierusalimschy wrote:
Due to the introduction of labels, '@' can now appear as the first
character in a valid Lua chunk. This means that the following passage
from lua_Debug is incorrect: "If source starts with a '@', it means
that the function was defined in a file where the file name follows
the '@'. If source starts with a '=', the rest of it should describe
the source in a user-dependent manner. Otherwise, the function was
defined in a string where source is that string."
We thought about that. At the time, it seemed that users could simply
avoid starting a chunk with a label (a simple space, newline, or a
comment would be enough). But now that thought seems feeble. The two
obvious solutions would be to change the character that marks filenames
or the character that starts labels. The second option has the slight
advantage of not creating a small incompatibility. Suggestions?
-- Roberto
Mmm, IMHO better to change the syntax for label.
BTW they look a bit ugly as they are now (but maybe this is intended :-)
If the start character must be something unused in Lua, there are few
alternatives among ASCII: #, $, |, &, ?, !, `.