(char) documentation

For the Compleat Fan
Locked
Dmi
Posts: 408
Joined: Sat Jun 04, 2005 4:16 pm
Location: Russia
Contact:

(char) documentation

Post by Dmi »

syntax: (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
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

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

Lutz

Dmi
Posts: 408
Joined: Sat Jun 04, 2005 4:16 pm
Location: Russia
Contact:

Post by Dmi »

Code: Select all

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

Locked