Sum types for Siml - implement as Float | String
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Freeode |
New
|
Medium
|
Unassigned |
Bug Description
Implement sum types for Siml. Use the bitwise or "|" operator.
Imlpement __or__, __ror__ methods for classes, and let them return sum types.
Imlpement __or__, __ror__ methods for classes, and let them return sum types. Sum types can simplify the implementation of mixed arithmetic for example between Float and Quantity.
Sum types can simplify the implementation of mixed arithmetic for example between Float and Quantity.
{{{
func __add__(this: Qty, other: Qty | Float): ...
func __add__(this: Qty, other: Qty | Float):
...
}}}
Oterwise the __add__ would need to raise a type exception or return NotImplemented.
Oterwise the __add__ would need to raise a type exception or return !NotImplemented.
Changed in freeode: | |
importance: | Undecided → Wishlist |
milestone: | none → 0.4.2 |
description: | updated |
description: | updated |
Changed in freeode: | |
importance: | Wishlist → Medium |
description: | updated |