[Chicken-users] my errors with eval

2013-07-02 Thread Daniel Ajoy
Hi, Both this (let ((a 1) ) (define (inc) (set! a (+ 1 a ) ) ) (define (runTwice op ) (op) (op) ) (eval '(runTwice inc ) ) ) and this (let* ((a 1) ) (define (inc) (set! a (+ 1 a ) ) ) (define (runTwice op ) (op) (op) ) (eval

Re: [Chicken-users] my errors with eval

2013-07-02 Thread Jim Ursetto
You can't access internal defines in an eval, just as you can't access the lexical variable a. To get around this you could use set! instead to define the variables at toplevel. (let ((a 1)) (set! inc (lambda () (set! a (+ 1 a)) (print a))) (set! runTwice (lambda (op) (op) (op))) (eval