I think this is very good. One small feature that might also be of utility
especially for simple enums is to be able to have a default "value"
attribute with its type automatically determined such as:

enum Weather {
       CALM=1,STORM=10,HURRICANE=40
}

or with the type asserted in the model such as 

enum<double> Weather {
       CALM=1.55,STORM=10.1,HURRICANE=40.5
}

However without the above, I am inclined to think that what you have
provided here will do almost about all one might need an enum for in a
generic sense.


Patrik Nordwall wrote:
> 
> We have started with the enum implementation and it would be interesting
> to find out what you (anyone) think should be supported and how it should
> be expressed.
> 
> I have been doing some prototyping of the DSL syntax. What do you think
> about this?
> 
> Simple enum:
>         ValueObject Weather {
>             Date day;
>             - @WeatherClassification classification;
>         }
>         
>         enum WeatherClassification {
>             SUNNY, WINDY, CLOUDY;
>         }
> 
> 
> Enum with attribute:
>         ValueObject Weather {
>             Date day;
>             - @WeatherClassification classification;
>             - @WindSpeed wind;
>         }
>         
>         enum WindSpeed {
>             int beaufortNumber; 
>               
>             CALM(beaufortNumber="1"),
>             STORM(beaufortNumber="10"),
>             HURRICAN(beaufortNumber="12");
>         }
> 
> 
> Enum with several attributes:
>        ValueObject Weather {
>             Date day;
>             - @WeatherClassification classification;
>             - @WindSpeed wind;
>         }
>                
>         enum WindSpeed {
>             int beaufortNumber;
>             double minMps;
>             double maxMps;
>               
>             CALM(beaufortNumber="1", 
>                 minMps="0",
>                 maxMps="0.2"),
>             STORM(beaufortNumber="10", 
>                 minMps="24.5",
>                 maxMps="28.4"),
>             HURRICAN(beaufortNumber="12", 
>                 minMps="32.7",
>                 maxMps="40.8");
>         }
>  
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Enums-tp13922588s17564p14426610.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Fornax-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to