lua-users home
lua-l archive

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


On Jan 23, 2008 8:56 AM, Fabien <fleutot+lua@gmail.com> wrote:
>  http://metalua.blogspot.com/2008/01/simple-extension-with-catch.html
>
> (It describes how a seemingly trivial catch...with extension is not so
> trivial after all, if you want to make it usable).

Ouch! I found this problem as well when writing proper tests (;)) for
LuaMacro. The hack is to detect if any non-nil value is returned, but
it leaves this rather important 'corner' case broken:

try
  return
else
end
print 'gets here!'

So, point taken; for anything non-trivial you have to parse the code!

Also, the general point is that syntax extensions have to be as robust
as any other language feature is well taken.  Another moral: if you
have to know the limitations of a preprocessor, it is broken (cpp is
case in point)

steve d.