newLISP Fan Club

Forum => Anything else we might add? => Topic started by: Dmi on April 08, 2006, 02:38:51 PM

Title: (char) documentation
Post by: Dmi on April 08, 2006, 02:38:51 PM
Quotesyntax: (char int)

Given an integer argument, char returns a string containing the ASCII character with value int.

Probably, it will be good to also mention that integers, greater than 255 are translated too, based on their lowest byte.

For noting the programmer that the range check may be needed.



Some systems (such as ncurses) uses integers, greater than 255 for various control keycodes.
Title:
Post by: Lutz on April 08, 2006, 04:50:20 PM
Only on UTF-8 versions of newLISP the int is taken as Unicode and a UTF-8 multi-byte character is returned.



Lutz
Title:
Post by: Dmi on April 08, 2006, 04:56:22 PM
dmi@dc:nlc-1.5$ newlisp
newLISP v.8.8.0-p2 on linux, execute 'newlisp -h' for more info.

> (char 330)
"J"
> (char 74)
"J"
>

Nothing wrong, but this isn't documented.