Skip to content

Fix require#149

Open
Whoome wants to merge 5 commits into
neolithos:masterfrom
Whoome:fix_require
Open

Fix require#149
Whoome wants to merge 5 commits into
neolithos:masterfrom
Whoome:fix_require

Conversation

@Whoome

@Whoome Whoome commented Jan 18, 2022

Copy link
Copy Markdown

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

neolithos commented Jan 20, 2022

Copy link
Copy Markdown
Owner

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

Can you rebase this pull request?

@neolithos

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