Closed ghost closed 3 years ago
Hi @Rabios
Thanks so much for the fixes!
and
/or
is incorrect -- if the true case evaluates to a falsy (false
/nil
) value the false case will be always be returned. e.g. 1 ? NULL : thing
expects NULL
while (1~=0) and nil or thing
in lua gives thing
. and
/or
expression instead of lambda iff the operands are numerical types, since lua considers 0 to be true.Problem with require when module not found, I tested it on https://repl.it so for this reason i decided to implement solve for bit operations...
And thanks!
About hilbert example, When did Moonscript transpiler with ternary if from Lua you did, It gives me output: 1 0 1 0 1
Just, That's from generated Lua by MoonScript compiler...
Hi @Rabios, thanks for the clarification
(bit or bit32)
is that the lua interpreter there is out of date by 14 years (print(_VERSION)
gives 5.1). Nevertheless I think your change is good -- the require
is neater than the current solution anywaysand/or
implementation (whatever it has to do with Moonscript), produces incorrect behavior in standard Lua, so I don't think that's very acceptable :) Anyways I'm happy to merge the require
fix, and if you come up with an alternative ternary operator implementation with correct behavior, then that too.
Thanks again!
isn't Moonscript a language that compiles to lua?
Yes it is...
How does it relate to the output of wax?
Cause i did wax transpiler for MoonScript, So yep i transpiled hilbert to MoonScript with transpiler i made for it to test it... And from MoonScript generated code i used MoonScript to transpile generated MoonScript code to Lua...
Currently, this new and/or implementation (whatever it has to do with Moonscript), produces incorrect behavior in standard Lua, so I don't think that's very acceptable :)
OK, I think we should close this pull request and..., Just put edits on bit and bit32 (It's up to you...)
And i'm very thankful that you liked my contribution...
Merged, and manually reverted the ternary operator. Thanks for the PR and sorry for the delay!
Fixes: