On 1/5/11 2:04 PM, Leo Razoumov wrote:
On Wed, Jan 5, 2011 at 06:36, Henning Diedrich <firstname.lastname@example.org> wrote:I chose % but it can be anything of course, just by changing the char in line 850 in file src/lparser.c.would your use of %-length operator interfere with Lua's default meaning of % as a modulus operator.
I am guessing there, because I don't think it will stay '%'.
My logic was that '-' is likewise used as unary prefix, and binary infix, so
my /hope/ was that the mechanism should be the same for any
character. It looked quite liberal in the source, seems to work but I am
not sure. It looked like unaries are protected by a high precedence and
that might cause unexpected results, haven't mulled that really.
As an alternative I would suggest '$' character for your length op. On my US-en keyboard $ is next right to #.
Sure, $ may be better. It's really just exchanging one char in the source
but as I said, maybe it is cleaner to go for a built in function.
Maybe we find a character that has some association with 'length'
already. I think $ does actually, does'nt it?