[Cuis-dev] Some un-accurate information on The Cuis Book
ken.dickey at whidbey.com
ken.dickey at whidbey.com
Mon Feb 27 06:43:48 PST 2023
Luciano,
Thanks so much for this explination!
I was looking for simplicity, but Complex "numbers" are not a kinds of
Number and are not simple.
I think some "Here be Dragons" text should be added to
Complex>>real:imaginary:
Perhaps something like the attached..
How does this look to you?
Thanks again,
-KenD
=====
On 2023-02-27 03:09, Luciano Notarfrancesco via Cuis-dev wrote:
> Hi Ken,
> I don't have a strong opinion about Complex and I'm cool with either
> option, specially because it's not in the base image and because I
> don't really use the package. But for this kind of situation I tried
> both approaches (reducing them or not), and in general I decided to not
> reduce them. One of the reasons is that if you reduce them then you
> might end up with a Number instead of an instance of Complex, and for
> it to be consistent you'd have to implement the Complex protocol in
> Number, or you might get a MNU. In fact I ended up implementing my own
> "fractions" (that I call Rational) and they don't reduce to integers.
> Another reason for doing it like this with fractions and other
> "numbers" is to avoid ambiguities, for example I have the message
> isUnit that returns true if the element has an inverse, and for example
> the rational number 2/1 is a unit (the inverse is 1/2) but the integer
> 2 is not a unit.
>
> Cheers,
> Luciano
>
> On Sun, 26 Feb 2023 at 20:48 ken.dickey--- via Cuis-dev
> <cuis-dev at lists.cuis.st> wrote:
>
>> On 2023-02-26 05:31, ken.dickey--- via Cuis-dev wrote:
>>
>>> BTW, we can do better. I think -4+0i above should be and print as
>>> -4.
>>
>> Ah! The code is already there and just needed to be uncommented
>> (attached).
>>
>> As we have Complex>>basicReal:imaginary: why does
>> Complex>>real:imaginary not do the simplification? Can we not just
>> enable this?
>>
>> Thanks,
>> -KenD
>> --
>> Cuis-dev mailing list
>> Cuis-dev at lists.cuis.st
>> https://lists.cuis.st/mailman/listinfo/cuis-dev
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Complex class-realimaginary.st
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230227/c0be70d6/attachment.ksh>
More information about the Cuis-dev
mailing list