Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix require #149

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Fix require #149

wants to merge 5 commits into from

Conversation

Whoome
Copy link

@Whoome Whoome commented Jan 18, 2022

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
Copy link
Owner

neolithos commented Jan 20, 2022

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
Copy link
Owner

Can you rebase this pull request?

@neolithos
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants