« first day (3606 days earlier)      last day (1352 days later) » 
00:00 - 23:0023:00 - 00:00

11:00 PM
@Crell Sorry, named property, not named param.
Still, if we use is a type (without ::) would be more intuitive and consistent I think...
 
But how do you specify the names?
Hang on, let me dig out some of my noodling examples to show what I mean.
 
enum Result {
    Ok($ok)
    Error($error)
}
What I really dislike about separating enums and ADTs is that the way you use them completely changes depending on which one you use. If you need to add a single case with an associated value to an enum you need to convert it to an ADT and adjust all the usages of it.
 
(Reload, added to it.)
So you can do:
enum Optional {
  case None;
  case Some($val);
}
And now derive that $some->val is a legit read only property. And control its visibility with constructor promotion syntax.
But this, you have no way to determine the property name:
enum Direction {
  case Up('forward');
  case Down('backward');
}
So if I have a $down, how do I get the string "backward"?
 
@Crell Yeah the two aren't really compatible. I don't really like the Java approach anyway.
enum Direction {
    case Up = 'forward';
    case Down = 'backward';
}
That looks more logical to me.
That is, in cases where enums are just simple wrappers around primitive values.
Ugh, it's Monday, 1am. You know what that means, I would really really go to bed ^^
 
11:15 PM
SIlly timezones.
I was hoping to avoid enum-as-primitive-alias entirely.
Also, it would allow you to have multiple associated values.
 
@Crell Yeah me too actually. Anyway, I'm done for today. See you tomorrow :)
 
Nighty night.
 
00:00 - 23:0023:00 - 00:00

« first day (3606 days earlier)      last day (1352 days later) »