-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
This proposal is a breaking change.
The previous if keyword needs to be changed to case, and else need to be changed to default.
Why?
Consider we wants to create the following function:
(this Int).compare(that Int) =
this.==(that).
case(true):
(0)
case(false):
(this.>(that).
case(true):
(1)
case(false):
(1.negate))That is tedious, so we should do like this instead:
(this Int).compare(that Int) =
this.
if(.==(that)):
(0)
if(.>(that)):
(1)
else:
(1.negate)Is much more cleaner, however, needs more revision on this.
Reactions are currently unavailable