GithubHelp home page GithubHelp logo

Comments (11)

well-in-that-case avatar well-in-that-case commented on May 12, 2024

There's already a patch introduced for this type of function declaration, so this is likely something I can implement with minimal headache (but I could be wrong). As for properties, I will need to review the parser, but I imagine it can be done, but this may be redundant too since it plays no effect in the behavior of the table (you still create them with the create function). Not so sure about the struct keyword, appears redundant. After all, it's not a structure, it's just a table. And if I did implement it, it would just be skipped by the parser. So you could imagine.

But otherwise, suggestion seems nice. I'll keep ya posted.

from pluto.

Frityet avatar Frityet commented on May 12, 2024

I was already working on an implementation on my fork, what is the function declaration you are talking about?

from pluto.

well-in-that-case avatar well-in-that-case commented on May 12, 2024

I was already working on an implementation on my fork, what is the function declaration you are talking about?

http://lua-users.org/wiki/LuaPowerPatches
Ctrl + F "Function fields". Patched into Lua 5.2 already, so it may only need updating and credit.

Edit, link is down. Searched through the web server manually and got the file:
http://lua-users.org/files/wiki_insecure/jRhQ0hat/5.2/oofunc.diff

from pluto.

Frityet avatar Frityet commented on May 12, 2024

The reason why I am making a new keyword is because the functionality it intends to abstract over is not just a table/function, it's also the setmetatable function calls, and the indexing. It would be ambiguous as just a table

from pluto.

well-in-that-case avatar well-in-that-case commented on May 12, 2024

Why would setmetatable be needed? And why would indexing need to change too?

from pluto.

Frityet avatar Frityet commented on May 12, 2024

It is the idomatic way of doing this paradigm. I also want to add a "private" attribute that is only valid in the struct declaration which would make it only available to methods in the struct. This would not make any sense outside of the struct declaration, and even in a regular table

from pluto.

well-in-that-case avatar well-in-that-case commented on May 12, 2024

That's about inheritance, which is fairly unrelated. Users can do this manually in their create function, or whatever they decide to call it. Private is not possible.

from pluto.

well-in-that-case avatar well-in-that-case commented on May 12, 2024

Progress update,
https://github.com/well-in-that-case/Pluto/tree/0.3.0

from pluto.

Frityet avatar Frityet commented on May 12, 2024

Progress update,

https://github.com/well-in-that-case/Pluto/tree/0.3.0

Thank goodness, the lua parser was killing me

from pluto.

well-in-that-case avatar well-in-that-case commented on May 12, 2024

@Frityet https://pluto-lang.org/docs/New%20Features/Object-Oriented%20Programming

from pluto.

Frityet avatar Frityet commented on May 12, 2024

@Frityet pluto-lang.org/docs/New%20Features/Object-Oriented%20Programming

Yep! I have been folliwng this project closely, looks great

from pluto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.