Objective Lua - additional syntax to original Lua!

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
zorg
Party member
Posts: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Objective Lua - additional syntax to original Lua!

Post by zorg »

more than that, since lua supports multiple assignment, would multiple compound assignment be supported?

a,b*=b+5,1-a

->

a,b = a*(b+5),b*(1-a)
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
lauriszz123
Prole
Posts: 11
Joined: Thu Oct 04, 2018 1:01 pm

Re: Objective Lua - additional syntax to original Lua!

Post by lauriszz123 »

Objective Lua Version 2.4 Released
As per pgimeno's claim I've added support for:

Code: Select all

local i = 0
i += expression
i -= expression
i *= expression
i /= expression
i ^= expression
i %= expression
As well as zorg's claim:

Code: Select all

a, b, c *= expression, expression, expression
Which all of these expressions evaluate to:

Code: Select all

i = i + ( expression )
i = i - ( expression )
i = i * ( expression )
i = i / ( expression )
i = i ^ ( expression )
i = i % ( expression )
a, b, c = a * ( expression ), b * ( expression ), c * ( expression )
User avatar
4vZEROv
Party member
Posts: 126
Joined: Wed Jan 02, 2019 8:44 pm

Re: Objective Lua - additional syntax to original Lua!

Post by 4vZEROv »

Some stuff that doesn't work:

Code: Select all

self.x += .5
self.x += (function return 5 end)()
lauriszz123
Prole
Posts: 11
Joined: Thu Oct 04, 2018 1:01 pm

Re: Objective Lua - additional syntax to original Lua!

Post by lauriszz123 »

Objective Lua Version 2.5 Released
Fixed bugs that 4vZEROv addressed. Thanks!
The new version is in the GitHub repo here!
User avatar
4vZEROv
Party member
Posts: 126
Joined: Wed Jan 02, 2019 8:44 pm

Re: Objective Lua - additional syntax to original Lua!

Post by 4vZEROv »

Don't work either

Code: Select all

local y = {[1] = 5, w = 10}
y[1]   += 5
y['w'] += 10
y["w"] += 10
lauriszz123
Prole
Posts: 11
Joined: Thu Oct 04, 2018 1:01 pm

Re: Objective Lua - additional syntax to original Lua!

Post by lauriszz123 »

Objective Lua Version 2.6 Released
Fixed bugs that 4vZEROv addressed. Thanks again 4vZEROv! :awesome:
All in all 2.6 I think is the release that should improve stability with math operations. If any bugs spotted, feel free to give me an example of it and I will quickly iron it out!
The new version is in the GitHub repo here!

Regards,
Laurynas.
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: Objective Lua - additional syntax to original Lua!

Post by grump »

Code: Select all

a += nil or 1
a += a > 0 and 1 or 2
a += -b
a += --[[ test ]] 1
a, b += (function() return 1, 2 end)()
Post Reply

Who is online

Users browsing this forum: No registered users and 45 guests