Implement 'char->integer' and 'integer->char' in Scheme

Issue #43 resolved
Katie Burke created an issue

char->integer returns the Unicode scalar value of char as an exact integer.
integer->char returns the character corresponding to the Unicode scalar value n.
http://www.scheme.com/tspl4/objects.html#./objects:s210
These examples should return 10 and #\0 respectively.

(char->integer #\newline)

Traceback (most recent call last):
File "stdin", line 1, col 2
RunTimeError: unbound variable 'char->integer'

(integer->char 48)

Traceback (most recent call last):
File "stdin", line 1, col 2
RunTimeError: unbound variable 'integer->char'

Comments (2)

  1. Log in to comment