GithubHelp home page GithubHelp logo

Discussion about namespaces about lobster HOT 3 CLOSED

aardappel avatar aardappel commented on July 22, 2024
Discussion about namespaces

from lobster.

Comments (3)

aardappel avatar aardappel commented on July 22, 2024

Yes, it is mostly text inclusion, and there are no namespaces. Lobster has grown from a much simpler language, and it just never happened, but it should.

There is the private keyword which removes a function/struct/variable from the global namespace, and makes it only available to the current file. This was I guess the simplest thing to make things workable without namespaces :)

builtin functions tend to use explicit identifier namespacing, e.g. gl_.

Haven't spent much time thinking what namespaces should look like if they are added. Not a fan of :: since it is "loud", or "." since it makes it look the same as dereferencing. I like _, but that clashes with its existing use in identifiers.

from lobster.

aardappel avatar aardappel commented on July 22, 2024

I guess include/gui.lobster is a good example of how currently a library is written with an explicit namespace and private. It be easy to add a namespace gui declaration that would achieve the same thing without having to explicitly prepend gui_ to all public functions in that file. Or it could use something other than ., but that would require changes in all users.

from lobster.

aardappel avatar aardappel commented on July 22, 2024

Lobster has namespaces nowadays :) See namespace in http://aardappel.github.io/lobster/language_reference.html

from lobster.

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.