Yoshiki Hayashi <t90553(a)mail.ecc.u-tokyo.ac.jp> writes:
| 1) Don't allow anything
| 2) Accept 0-127
| 3) Accept 0-256
^^^
I meant 255. Thanks, Adrian.
"Stephen J. Turnbull" <turnbull(a)sk.tsukuba.ac.jp> writes:
Yoshiki> Still, you can do
Yoshiki> (let ((i 1442))
Yoshiki> (while (i < 2000)
Yoshiki> (insert (int-to-char i))
Yoshiki> (setq i (+1 i))))
This is exactly the kind of code that we should disallow. What does
each of those 558 characters mean when inserted in the buffer? Surely
most of them are not characters in any known character set. Should
they be inserted? Ignored? Do you tell the user what you've done?
In which functions do you want to put the checking code? What are you
supposed to do with the integers that are not characters: signal an
error, display a warning, set a flag for user code to check?
Signal an error. This is for people who understand the
problem dealing with internal representation and still want
to use it. Desired code is like this
(let ((i 32))
(while (< i 128)
(insert (make-char 'latin-iso8859-9 i))
(setq i (1+ i))))
which does not depend on internal representation.
int-to-char is broken except US-ASCII range, but if
compatibility is needed, I'd like to force people to use
only int-to-char to know it is broken.
If we won't make any change, the code dealing with 1442 and
such will become silently broken, due to two leading-byte
change.
--
Yoshiki Hayashi