Console I / O in Common Lisp

In Common Lisp, I am writing a console application. I have finished most of the code, but the two critical parts still confuse me.

  • How to read the key from the input and get the ascii code for it.

  • How to display ascii character without special formatting or newline.

Secondly, I tried:

(print (code-char 69))

What is displayed:

#\E

But I just want it to display plain:

E

First off, I’m out of luck.

If this helps, I run clisp on Linux and OS X. Thanks!

+3
source share
2 answers

. read- char write- char CLHS. READ- CHAR . Portable Common Lisp "", .

. char -code.

+7

"E",

(princ (code-char 69))
+1

Source: https://habr.com/ru/post/1777765/


All Articles