Sum types for Siml - implement as Float | String

Bug #604823 reported by Eike
6
This bug affects 1 person
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.

https://sourceforge.net/apps/trac/freeode/ticket/21

Eike (eike-welk)
Changed in freeode:
importance: Undecided → Wishlist
milestone: none → 0.4.2
Eike (eike-welk)
description: updated
Eike (eike-welk)
description: updated
Eike (eike-welk)
Changed in freeode:
importance: Wishlist → Medium
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.