; the next 4 lines are Chicken symbols unknown to PLT. ; (define signum 43) (define conj 44) (define quotient&modulo 46) ; (define quotient&remainder 47) (define randomize 48) (define bignum? 49) ; (define ratnum? 50) (define cflonum? 51) (define rectnum? 52) ; (define compnum? 53)(define cintnum? 54) (define cplxnum? 55) ; (define (ex m v) (write (cons m v)) (newline) v) (define (newEnvSrc n) (let ((ne (scheme-report-environment n)) (opl '(+ - * / = > < >= <= number->string string->number eqv? equal? ; From scheme. Structural & bytevector comparisons Just Work exp log sin cos tan atan acos asin expt sqrt quotient modulo remainder numerator denominator abs max min gcd lcm positive? negative? odd? even? zero? exact? inexact? rationalize floor ceiling truncate round inexact->exact exact->inexact number? complex? real? rational? integer? make-rectangular make-polar real-part imag-part magnitude angle)) (nopl '(add1 sub1 ; In PLT but not R5RS: signum conj quotient&modulo quotient&remainder random randomize bignum? ratnum? cflonum? rectnum? compnum? cintnum? cplxnum? bitwise-and bitwise-ior bitwise-xor bitwise-not arithmetic-shift)) (gs (lambda (n) (string->symbol (string-append "S" (number->string n)))))) (let ((tl (append opl nopl))) (apply (eval `(lambda ,(let gx ((l tl)(n 0)) (if (null? l) '() (cons (gs n) (gx (cdr l) (add1 n))))) ,(cons 'begin (let nolg ((nml nopl)) (if (null? nml) (let olg ((n 0)(ol tl)) (if (null? ol) '(42) (cons `(set! ,(car ol) ,(gs n)) (olg (add1 n) (cdr ol))))) (cons `(define ,(car nml) 42) (nolg (cdr nml))))))) ne) (map eval tl))) ne)) ;(eval '(+ 4 6) (newEnvSrc 5)) ;Want: ;((lambda (S0 S1 ...) (set! + S0) (set! - S1) ... ) + - ... )