(char) documentation

Started by Dmi, April 08, 2006, 02:38:51 PM

Previous topic - Next topic

Dmi

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.
WBR, Dmi

Lutz

#1
Only on UTF-8 versions of newLISP the int is taken as Unicode and a UTF-8 multi-byte character is returned.



Lutz

Dmi

#2
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.
WBR, Dmi