lua-users home
lua-l archive

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


> Here's my semi-regular posting about erlang style numbers... this time
> as an excuse to play with Luiz' token filter. Below is the code to
> support this interesting (to me at least) extension:

See, no need for C hacking! :-) And pretty easy to do it in Lua, right?
(I'm not blowing my own horn here; just remarking that token filters can be
a better alternative to hacking the Lua core to add more sugar.)

> -- 2#1001 means base "2" numeric constant "1001" or 9 in decimal

Just note that you cannot enforce that the three parts are a single token,
that is, 2   #   1001 will be accepted as a binary constant. Just don't
tell your users about it :-)
--lhf