Changeset 32323 for lang/commonlisp

Show
Ignore:
Timestamp:
04/13/09 08:40:37 (4 years ago)
Author:
mokehehe
Message:

修正

Location:
lang/commonlisp/paip
Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • lang/commonlisp/paip/22/22.5.l

    r31811 r32323  
    8989(defun extend-env (vars vals env) 
    9090  "Add some variables and values to an environment." 
    91   (cond ((null vars) 
    92                  (assert (null vals) () "Too many arguments supplied") 
    93                  env) 
    94                 ((atom vars) 
    95                  (cons (list vars vals) env)) 
    96                 (t (assert (rest vals) (first vals)) 
    97                    (extend-env (rest args) (rest vals) env)))) 
     91  (nconc (mapcar #'list vars vals) env)) 
    9892 
    9993(defun scheme-macro (symbol) 
  • lang/commonlisp/paip/23/23.1.l

    r31811 r32323  
    7676         (comp-if (second pred) else then env val? more?)) 
    7777        (t (let ((pcode (comp pred env t t)) 
    78                          (tcode (comp pred env val? more?)) 
    79                          (ecode (comp pred env val? more?))) 
     78                         (tcode (comp then env val? more?)) 
     79                         (ecode (comp else env val? more?))) 
    8080                 (cond 
    8181                   ((equal tcode ecode) ; (if p x x) => (begin p x) 
     
    114114           (assert (null args) () "Too many arguments supplied") 
    115115           (comp-begin (rest2 f) env val? more?)) 
    116           (moer? ; Need to save the continuation point 
     116          (more? ; Need to save the continuation point 
    117117           (let ((k (gen-label 'k))) 
    118118                 (seq (gen 'SAVE k) 
     
    123123                          (if (not val?) (gen 'POP))))) 
    124124          (t   ; function call as rename plus goto 
     125           (assert (or (symbolp f) 
     126                                   (consp f)) 
     127                           () "Function must be symbol or cons") 
    125128           (seq (comp-list args env) 
    126129                        (comp f env t t) 
     
    218221(defun scheme-macro-expand (x) 
    219222  "Macro-expand this Scheme expression." 
     223(print (list 'scheme-macro-expand x)) 
    220224  (if (and (listp x) (scheme-macro (first x))) 
    221225          (scheme-macro-expand