Coder Social home page Coder Social logo

Comments (9)

leafpetersen avatar leafpetersen commented on May 28, 2024

cc @munificent @lrhn

from language.

lrhn avatar lrhn commented on May 28, 2024

I'm unable to find other requests for the same thing (which surprises me, except that I can never find anything using GitHub search).

What we are asking for here is a shorter syntax to write a simple class, without having to repeat the field names (or even class name) in a constructor.

from language.

zoechi avatar zoechi commented on May 28, 2024

@lrhn perhaps dart-lang/sdk#10551, dart-lang/sdk#10374

from language.

SAGARSURI avatar SAGARSURI commented on May 28, 2024

Is there something similar to inline classes in Dart?

from language.

eernstg avatar eernstg commented on May 28, 2024

No, we don't have that currently. The main property of an inline class (corresponding to Haskell newtype) is that it is a zero cost wrapper, in the sense that it is a new type which is distinct from (and not assignable to) the type of the wrapped value, but the run-time representation is just that wrapped value. One example of work in this direction is https://github.com/dart-lang/language/blob/master/working/static%20wrapper%20types/feature-specification.md.

from language.

SAGARSURI avatar SAGARSURI commented on May 28, 2024

Thanks @eernstg for the info. Excited for the above feature to be added in Dart.

from language.

eernstg avatar eernstg commented on May 28, 2024

Moving this issue to the language repo, it would be a language mechanism.

from language.

kevmoo avatar kevmoo commented on May 28, 2024

Seee #698 – covers your case nicely I think!

from language.

leafpetersen avatar leafpetersen commented on May 28, 2024

We're tracking this here, closing in favor of that issue (let me know if I've missed something distinct about this request.

from language.

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.