lua-users home
lua-l archive

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


That is very cool - you are doing transforms on the AST
representation, but the AST can be 'quoted'. I enjoyed Lisp in the
80s, but eventually got tired of writing programs virtually in raw
AST.

But, to refer to the point about losing lexical information; since
token filter extensions are hooked into the raw token stream, they can
actually give pretty appropriate error messages.

steve d.

On 10/31/07, Fabien <fleutot+lua@gmail.com> wrote:
>  -{block:
> mlp.stat:add{ 'try', mlp.block, 'except', mlp.block, 'end', builder =
> exn_builder }
> function exn_builder(args)
>     local try_block, exn_block = unpack(args)
>     return +{stat:
>       do
>          local status, exn = pcall(function() -{try_block} end)
>           if not status then -{exn_block} end
>       end }
> end }