Comments (2)
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.
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)
- Add hyperlink for platform import
- [XDK] SD card: appendingTextWrite size limit? HOT 2
- Implementation of Ping in MQTT
- No code generated for MQTTS Mita HOT 1
- Master is broken HOT 1
- using string as function parameter HOT 1
- string - verifiation rules? pair-rule ? HOT 1
- enum in struct HOT 2
- functions polymorphism and references HOT 2
- Authentication with certificate MQTTS
- native predefined values HOT 1
- xdk110 binding - ConnectivityWLANWifi_Enable() instead of exception = ConnectivityWLAN_Enable(); HOT 1
- Hono Mqtt is broken
- Global String Interpolation creates duplicate and invalid initialization code
- Error executing EValidator HOT 1
- Support for SPI on XDK HOT 1
- Updating the Xtext Community Website HOT 3
- XDK documentation for foreign functions not complete HOT 1
- Creation of custom REST interfaces HOT 1
- MQTTS - Error when trying to connect HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mita.