lua-users home
lua-l archive

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


On Mon, Aug 4, 2014 at 3:31 AM, Sim <Sim@iamsim.ru> wrote:
>> Hi,
>>
>> I know there are a zillion ways to do this, but it sounds to me that
>> they will either need an additional compilation step or a customized
>> interpreter, or extra keystrokes
>>
>> What I am asking for is a simple '@' symbol for annotation that would
>> be safely discarded; (-- would work, but I would just hope for an even
>> simpler symbol)
>>
>> Would this ever be taken?
>>
>> Thanks
>
> Hi!
> I completely agree about usefulness annotations.
> Today it may be created like this using Metalua
> (http://lua-users.org/wiki/MetaLua) extension:
>
> local someTable = {
> -{ persistent() }
> id = 15,
> -{ persistent() }
> name = 'user',
> }
>
> You mean, that should be clear syntax like:
>
> local someTable = {
> @persistent
> id = 15,
> @persistent
> name="user",
> }
>
> Am I correct?

Exactly, I would prefer the injection/extension to Lua in a simpler
manner - if Lua/LuaJIT didn't recognize the annotation, it would just
silently ignore it, while leaving the room for additional parsing or
post-processing.

The idea is just simply to have the interpreter be able to parse the
source code without additional compiling steps - which could be
un-productive IMHO.

>