neolithos / neolua

A Lua implementation for the Dynamic Language Runtime (DLR).
https://neolua.codeplex.com/
Apache License 2.0
466 stars 76 forks source link

Fix require #149

Open Whoome opened 2 years ago

Whoome commented 2 years ago

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.

neolithos commented 2 years ago

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 commented 2 years ago

Can you rebase this pull request?

neolithos commented 1 year ago

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