summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2017-12-19 11:37:33 -0800
committerKeith Packard <keithp@keithp.com>2017-12-19 11:37:33 -0800
commit53b99e0419cb44c7983e41026bf0430deae58940 (patch)
tree38ca984da391ccfc4c34d7713a049a9ad172bcff /src
parentfbe5dc9f215e7014aa8f9d325c1fba939816be03 (diff)
altos/scheme: (define (foo . bar)) has a pair, not list as card
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>
Diffstat (limited to 'src')
-rw-r--r--src/scheme/ao_scheme_const.scheme4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/scheme/ao_scheme_const.scheme b/src/scheme/ao_scheme_const.scheme
index 060fd955..4616477f 100644
--- a/src/scheme/ao_scheme_const.scheme
+++ b/src/scheme/ao_scheme_const.scheme
@@ -248,7 +248,7 @@
(macro (first . rest)
; check for alternate lambda definition form
- (cond ((list? first)
+ (cond ((pair? first)
(set! rest
(append
(list
@@ -640,7 +640,7 @@
(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))