I've added a multi-dimensional array indexing with comma syntax patch by Mark Fieldman.
It modifies the parser to support multi-dimensional array indexing with comma syntax, i.e. m[1,2] is treated by the parser as being identical to m[1][2], thus allowing for code such as the following:
m = {[1]={}, [2]="foo"}
m[1,2] = "bar"
print(m[2], m[1][2], m[1,2]) --> foo bar bar
m.foo = {}
m.foo.bar = "baz"
print(m["foo","bar"]) --> baz |
I've also added some mutation operators:
+= add
-= sub
*= mult
/= div
%= mod
^= power
a=4
a+=1 -- a is now 5
a^=2 -- a is now 25 |
These will save a lot of typing and should be faster because the source variable only needs to be looked up once.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
https://deluxepixel.com
Comments
Likes: antix, Atavismus
Besides, we have limited operator space I think (to fit in the bytecode), possibly right at the end.
https://deluxepixel.com
Likes: jdbc
https://deluxepixel.com
https://deluxepixel.com
Likes: SinisterSoft
https://deluxepixel.com
a+=b
a=a+b
https://deluxepixel.com
Likes: antix, SinisterSoft
https://github.com/gideros/gideros
https://www.youtube.com/c/JohnBlackburn1975
As you would expect, the right hand side of the operation is evaluated first, so:
https://deluxepixel.com
Likes: SinisterSoft
Fragmenter - animated loop machine and IKONOMIKON - the memory game
The extra operators, fake thread system, etc that have added are also completely optional - The Gideros version of lua is source code compatible with Lua 5.1. Your source code from other systems will work fine if you are moving to Gideros.
An enhancement to Gideros Lua a while back that made it have a universal 32/64 bit Lua bytecode. This means that the same bytecode will run fine on either a 32 or 64 bit computer. This gets rid of the problem of having to include (encrypted) source code in an iOS IPA file (like other systems do - that also have had their encryption cracked).
Likes: Atavismus, antix
https://deluxepixel.com
Likes: keszegh, pie, jdbc, antix, SinisterSoft, Yan
I don't know what the name of the mutation operators should be.
@totebo How do you add an extra tab - I have no idea.
https://deluxepixel.com
Likes: antix
Fragmenter - animated loop machine and IKONOMIKON - the memory game
https://deluxepixel.com
Likes: antix, SinisterSoft
http://docs.giderosmobile.com/reference/enhancement
Likes: totebo
https://deluxepixel.com
Likes: SinisterSoft
https://deluxepixel.com
p.s. great job, thanks!
Likes: SinisterSoft
https://deluxepixel.com