neolua icon indicating copy to clipboard operation
neolua copied to clipboard

Fix require

Open Whoome opened this issue 3 years ago • 3 comments

Fixed require to work the same as Lua 5.3, with the exception that no C native librares are supported and package.config is still ignored.

Whoome avatar Jan 18 '22 17:01 Whoome

Are you so kind and split the pull requests?

LuaTable supports the LuaMember...

public class LuaMath : LuaTable
{
[LuaMember]
public double abs(double value)
...

it is functional equal to

math["abs"] = new Func<double, double>(Abs);

but supports overloads and is a little bit optimized.

Only variables should be set like

math["PI"] = Math.PI

Or

public double PI  => Math.PI;

The last variant, can be reset by Math.PI = nil .

If do not want, the value should be changed:

[LuaMember]
public double PI {get => Math.PI; set {} }

And please fix the formatting of your changes.

Overall good work.

neolithos avatar Jan 20 '22 17:01 neolithos

Can you rebase this pull request?

neolithos avatar Aug 20 '22 09:08 neolithos

It would be nice, if you rebase or send me a diff with your changes.

neolithos avatar Jun 30 '23 15:06 neolithos