lua-users home
lua-l archive

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

> One could even do this:
> mode = 'BACKSYSTEM'
> mode = mode .. '|BACKVIDEO'
> On the other hand, it is *worse* than simple numeric mapping
> because of all the string parsing this implies, just to 
> ORing some constants. Knowing that 'premature optimization 
> is the root of all evil', 

You could also cache all strings seen by the conversion function
and so avoid the parsing for common cases.

My arithmetic expression library ae does that.