char-generator Bradley Lucier (14 Jan 2024 17:45 UTC)
Re: char-generator Per Bothner (14 Jan 2024 17:59 UTC)
Re: char-generator Marc Nieper-Wißkirchen (14 Jan 2024 18:02 UTC)
Re: char-generator John Cowan (16 Jan 2024 02:28 UTC)
Re: char-generator Per Bothner (16 Jan 2024 06:10 UTC)
Re: char-generator Antero Mejr (16 Jan 2024 16:49 UTC)
Re: char-generator John Cowan (17 Jan 2024 02:49 UTC)
Re: char-generator Marc Nieper-Wißkirchen (14 Jan 2024 18:00 UTC)
Re: char-generator Bradley Lucier (14 Jan 2024 18:04 UTC)
Re: char-generator Marc Nieper-Wißkirchen (14 Jan 2024 18:06 UTC)
Re: char-generator Antero Mejr (15 Jan 2024 03:17 UTC)
Re: char-generator John Cowan (16 Jan 2024 01:40 UTC)

Re: char-generator Per Bothner 16 Jan 2024 06:10 UTC

On 1/15/24 18:28, John Cowan wrote:
>
> On Sun, Jan 14, 2024 at 12:59 PM Per Bothner <xxxxxx@bothner.com <mailto:xxxxxx@bothner.com>> wrote:
>     If you want a predicate to detect invalid code points (why? - what is the use case?)
>
> Because it's not a character.  (Are you sure you don't mean an unassigned code point?  That should not be an error.)

I was using "invalid" in response to Brad Lucier's message. We probably should have used "unassigned".

I'm thinking very operationally: (char? x) should return true iff the "type tag" of x is "character".
In a Java or CLR implementation "type tag" might mean the result of a getClass() method call.
I don't see any good reason to make char? more complicated or more specific.

Of course this does not preclude signalling an error if a "character constructor" (such
as the integer->char procedure) is passed invalid arguments. However, sting-ref should
never fail if the index is in range.
--
	--Per Bothner
xxxxxx@bothner.com   http://per.bothner.com/