lua-users home
lua-l archive

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


On 10/24/06, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> 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.)

Yeah, I like it... next comes the php-style variable expansion in
string constants!

As always, thanks for a fun and powerful language!

> -- 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