bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Confused ⎕UCS


From: Dr . Jürgen Sauermann
Subject: Re: Confused ⎕UCS
Date: Mon, 23 Nov 2020 22:21:41 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Hi Kacper, Adam,

thanks. For the sake of compatibility with IBM APL2 I have changed ⎕UCS so that
it accepts float and complex numbers that are near to integers.  My initial thinking was
that e.g. ⎕UCS of a complex number is most likely a programming mistake so
that a DOMAIN ERROR would be more helpful than being a burden. But APL2
compatibility is an even stronger argument in this case.

I have also adjusted the integer domain which is now -$80 ... $7FFFFFFF
so that no conflicts with signed bytes from ⎕FIO should arise.

SVN 1362.

Best Regards,
Jürgen



On 11/22/20 11:11 PM, Kacper Gutowski wrote:
On Sun, Nov 22, 2020 at 03:19:19PM +0100, Dr. Jürgen Sauermann wrote:
Floating point and complex numbers are not allowed as to avoid interference with ⎕CT (i.e. how should rounding be performed?).

I share your sentiment regarding the upper bound of the ⎕UCS domain, but throwing a domain error on ⎕UCS1E2 looks like a bug to me too.  1E2 is clearly an integer regardless of the implementation details, and I would be surprised if APL2 didn't accept it.  I would expect rounding to be the same as in all the other places that require near-integers, like array indices.

The negative ones are also a bit weird.  I wasn't aware of their existence, and they seem to work in surprising ways when passed to various variants of ⎕CR.

-k


reply via email to

[Prev in Thread] Current Thread [Next in Thread]