Git Product home page Git Product logo

Comments (2)

sawtschuk-appropos avatar sawtschuk-appropos commented on August 28, 2024

Unifying the C code so that Sum Generators can be reused is nice

But, if Sum Types and Enum Types end up having the same basic functionality, except that Enum can not hold Data, I would prefer that Enum Types are completely removed from the language.

It does not make sense to me to have two language constructs, where one is just a less powerful version of the other, but otherwise they behave exactly the same and have exactly the same usage.

This would seem especially true in regards to the fact that Eclipse Mita's intended purpose is to abstract the C language into something higher level, so that people do not have to learn, know, and understand C. Enums therefore would become obsolete in light of Sum Types.

Edit: If Enum is a Subset of Sum Types, and this makes Enum obsolete, then Enum would not be obsolete if Enum had syntactic use that Sum Types do not have.

from mita.

csweichel avatar csweichel commented on August 28, 2024

Mita should have enums - at least on a syntactic level as that's what many people expect. Name a language without enum support, or people complaining of the lack thereof. It just feels natural* to be able to write something like

enum Foobar { 
    foo,
    bar 
}

,* natural in the sense that this construct looks like something I've seen in many different languages, such as Java or Typescript to name two.

Also, our enums differ from C enums in that they cannot be cast to integers, i.e. are symbols "only".

All that said, I'm all for unifying enums with sum types on the backend but keeping the enum syntax.

from mita.

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.