altos/scheme: (define (foo . bar)) has a pair, not list as card
authorKeith Packard <keithp@keithp.com>
Tue, 19 Dec 2017 19:37:33 +0000 (11:37 -0800)
committerKeith Packard <keithp@keithp.com>
Tue, 19 Dec 2017 19:37:33 +0000 (11:37 -0800)
When defining a lambda with varargs, the args are not a list as the
final element is not a pair or nil. Use pair? instead of list? to
detect this form correctly.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/scheme/ao_scheme_const.scheme

index 060fd9552ddad8f255871f289056bca4a1a27662..4616477f55f9d6218fe36e59dc829cc5d01c51e8 100644 (file)
    (macro (first . rest)
                                        ; check for alternate lambda definition form
 
-         (cond ((list? first)
+         (cond ((pair? first)
                 (set! rest
                       (append
                        (list
 (char-whitespace? #\0)
 (char-whitespace? #\space)
 
-(define (char->integer c) c)
+(define char->integer (macro (v) v))
 (define integer->char char->integer)
 
 (define (char-upcase c) (if (char-lower-case? c) (+ c (- #\A #\a)) c))