ASCII character classification
Lassi Kortela
(22 Nov 2019 13:33 UTC)
|
Re: ASCII character classification
John Cowan
(22 Nov 2019 14:52 UTC)
|
Re: ASCII character classification
Lassi Kortela
(22 Nov 2019 19:24 UTC)
|
Re: ASCII character classification
John Cowan
(22 Nov 2019 19:33 UTC)
|
Re: ASCII character classification
Lassi Kortela
(28 Nov 2019 13:57 UTC)
|
Re: ASCII character classification
John Cowan
(28 Nov 2019 14:41 UTC)
|
Should ASCII procedures accept non-ASCII characters?
Lassi Kortela
(28 Nov 2019 15:00 UTC)
|
Re: Should ASCII procedures accept non-ASCII characters? Lassi Kortela (28 Nov 2019 15:08 UTC)
|
Re: ASCII character classification
Lassi Kortela
(29 Nov 2019 01:08 UTC)
|
Re: Should ASCII procedures accept non-ASCII characters? Lassi Kortela 28 Nov 2019 15:07 UTC
> Since ASCII characters and non-ASCII characters use the same concrete > type (Scheme characters or integers) I thought it's simplest if we > accept other characters. The implementation is also simple and fast: (define (ascii-control? x) (let ((cc (ensure-int x))) (or (<= 0 cc #x1f) (= cc #x7f)))) If we wanted to raise an error for non-ASCII characters, it would require extra code. IMHO this settles the question: accepting all characters permits both the interface and the implementation to be simpler.