fix evlis argumuent execution order.

This commit is contained in:
Jan Nieuwenhuizen 2016-07-09 22:01:00 +02:00
parent 6b54eb9d76
commit 1fe2fb51b1
3 changed files with 6 additions and 5 deletions

3
mes.c
View File

@ -405,7 +405,8 @@ evlis (scm *m, scm *a)
#endif #endif
if (m == &scm_nil) if (m == &scm_nil)
return &scm_nil; return &scm_nil;
return cons (eval (car (m), a), evlis (cdr (m), a)); scm *e = eval (car (m), a);
return cons (e, evlis (cdr (m), a));
} }
scm scm_evlis = {FUNCTION2, .name="evlis", .function2 = &evlis}; scm scm_evlis = {FUNCTION2, .name="evlis", .function2 = &evlis};

View File

@ -212,10 +212,7 @@
(getchar) (getchar)
'()) '())
;; TODO *dot* ;; TODO *dot*
(#t (xcons (readlis a) (readword (getchar) '() a))))) (#t (cons (readword (getchar) '() a) (readlis a)))))
(define (xcons a b)
(cons b a))
(define (readcomment c) (define (readcomment c)
(cond ((eq c 10) ;; \n (cond ((eq c 10) ;; \n

View File

@ -26,6 +26,9 @@
4 4
(newline) (newline)
(cons (display 'one) (display '-) (display 'two))
(newline)
(display 'hello-display-symbol) (display 'hello-display-symbol)
(newline) (newline)