Giter Site home page Giter Site logo

static members or alternative about ghul HOT 2 CLOSED

degory avatar degory commented on July 21, 2024
static members or alternative

from ghul.

Comments (2)

degory avatar degory commented on July 21, 2024

Have bodged static members for now, but leaning towards disallowing static members completely and relying on functions/properties etc. defined at namespace scope instead, combined with generic functions where needed. Doing this might reduce the need to recognize/disambiguate type expressions as primaries within value expressions.

namespace Util
    class SORT[T] is ... si

    sort[T](seq: Sequence[T]) is
        return new SORT[T](seq).sort();
    si
si

Util.Sort(["a", "b", "c"])

This might be difficult to disambiguate from a named indexer definition, but could just drop support for those.

from ghul.

degory avatar degory commented on July 21, 2024

Think the preferred option is a combination of traits, generic global functions and type inference.

from ghul.

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.