[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: [PATCH] bastardized lua #1
- From: Karel Tuma <ktuma@...>
- Date: Mon, 25 Sep 2006 12:06:20 +0200
This patch is part of somewhat larger project which called
for features contained in here. Sorry I don't have each part as a
patch, but I maintain it as it is. Still, some people might find it
All of this is highly experimental and most likely breaks lots of
Tested only on MacOSX/PowerPC.
This patch also aims to be syntax backward compatible with stock lua,
so if you encounter any discrepancy regarding that, tell me so.
Apply against 5.1.1
Backwards compatible: yes
Bytecode compatible: no (new binop opcodes)
Credits: Rici Lake, Asko Kauppi, Christopher Dunn, Eric Tetz et al.
- non-equality operator != along with ~=
- and, or, xor, shl, shr bit operators: &, |, ~, <<, >>
and appropiate metamethods: __and, __or, __xor, __shl, __shr
BUGS: probably broken on negative values
- __strhook for userdata-to-lua string masquerading (see
BUGS: better dont use it at all :)
- __usedindex! it's like __newindex, but only if key is
- "then" is optional after if, "do" is optional after
"while" and "for"
- Rici's pseudo values in assignments, ie:
a, b, c = $+1, $+1, $1+$2 is expanded to: a, b, c = a+1, b
This is very useful if you've long expression to modify as
tab[key].increment[y],tab[key].decrement[y] = $+1, $-1
Merged Asko Kauppi's power patches:
- do patch: Makes "= do ... end" be syntactic sugar for:
"= function() ... end" (handy with simple callbacks).
- continue patch
- literals patch (hex, utf8)
- integer optimization (non-FPU) - most of the bloat in the
Description: GNU Zip compressed data