Sum types for Siml - implement as Float | String

Bug #604823 reported by Eike on 2010-07-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Freeode
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) on 2010-07-12
Changed in freeode:
importance: Undecided → Wishlist
milestone: none → 0.4.2
Eike (eike-welk) on 2010-07-12
description: updated
Eike (eike-welk) on 2011-06-10
description: updated
Eike (eike-welk) on 2012-02-29
Changed in freeode:
importance: Wishlist → Medium
description: updated
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers