oscbyspro / Ultimathnum

Binary arithmetic reimagined in Swift
Apache License 2.0
4 stars 1 forks source link

Use (low:high:) and remove (high:low:) #20

Closed oscbyspro closed 2 weeks ago

oscbyspro commented 2 weeks ago

I want a canonical tuple format so that calling Doublet/components() instead of Doublet/ascending() and Doublet/descending() makes sense. All other objects destructure their contents by calling components(), and I want this to be consistent across the board. A recent change also made the 2nd and 3rd method easy to conflate with BinaryInteger/ascending(Bit) and BinaryInteger/descending(Bit). This project always view binary integers in ascending order, so (low:high:) makes the most sense to keep.

oscbyspro commented 2 weeks ago

Hm. I think I'll allow array-like init growth too:

T2()
T2(low: 1)
T2(low: 1, high: 2)

T3()
T3(low: 1)
T3(low: 1, mid:  2)
T3(low: 1, mid:  2, high: 3)

But I don't want to allow implicit leading zeros.