Please excuse me for bothering you with boring little things, but I have a strange behavior with the uLisp ARM 3.3a version running on a Serpente device:
This code snippet is to make sure that only 1 or 0 is entered:
(defun input-test () (let* (input_key) (loop (format t "~%Input [0/1]? ") (setq input_key (read-byte)) (format t " = ~a" input_key) (case input_key (((char-code #\0) (char-code #\1)) (return)) (50 (return)) ) ) (format t "~%~%OK - Input was: ~a" input_key) ) )
but the command (char-code #\0) seems not to be processed the right way…
This is what the output looks like:
2997> (input-test) Input [0/1]? 0 = 48 Input [0/1]? 1 = 49 Input [0/1]? 2 = 50 OK - Input was: 50 nil
only the number 2 (code: 50) works.
I also tested this line of code:
((#\0 #\1) (return))
But I think it should work like this, because the code corresponds to the example in “Lisp for C programmers”.
Only this one works:
((48 49) (return))
Thanks for your help