lua-users home
lua-l archive

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


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

What problem are you trying to solve? Annotations are typically used in compiled languages to carry over symbolic information to the run-time that would otherwise be discarded by the compiler. There are other ways to do this in Lua.

—Tim