You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In an of clause we write stuff like of x | y | Type. Why can't we write that in a case?
Currently Ceylon forces you to distinguish type cases from value cases using the is keyword, which very occasionally pushes you towards nastiness like this:
case (is\Itrue | \Inull | Foo) { … }
Are there any really compelling reasons to not let you just write:
case (true | null | Foo) { … }
Historically, I think there were some reasons, since I had speculated about a lot of different kind of case conditions, case (satisfies ... ), etc, which we still don't have. Also the syntax for value cases was different to the syntax for union types with the ,s instead of |s.
Right now, I can't really think of much.
The text was updated successfully, but these errors were encountered:
In an
of
clause we write stuff likeof x | y | Type
. Why can't we write that in acase
?Currently Ceylon forces you to distinguish type cases from value cases using the
is
keyword, which very occasionally pushes you towards nastiness like this:Are there any really compelling reasons to not let you just write:
Historically, I think there were some reasons, since I had speculated about a lot of different kind of case conditions,
case (satisfies ... )
, etc, which we still don't have. Also the syntax for value cases was different to the syntax for union types with the,
s instead of|
s.Right now, I can't really think of much.
The text was updated successfully, but these errors were encountered: