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 '
Mario Domenech Goulart writes:
> On Tue, 02 Jul 2013 21:56:01 +0400 Aleksej Saushev wrote:
>
>> ???
>
> with-output-to-file expects a thunk as second argument.
Hm... Alright. Stupid Scheme.
--
BCE HA MOPE!
___
Chicken-users mailing list
Chicken-us
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 '(runTw
On Tue, 02 Jul 2013 21:56:01 +0400 Aleksej Saushev wrote:
> $ csi
>
> CHICKEN
> (c) 2008-2013, The Chicken Team
> (c) 2000-2007, Felix L. Winkelmann
> Version 4.8.0.3 (stability/4.8.0) (rev 091c3d9)
> netbsd-unix-gnu-x86 [ manyargs dload ptables ]
> compiled 2013-03-12 on aeryn.xorinia.dim (Darwi
Hello!
$ csi
CHICKEN
(c) 2008-2013, The Chicken Team
(c) 2000-2007, Felix L. Winkelmann
Version 4.8.0.3 (stability/4.8.0) (rev 091c3d9)
netbsd-unix-gnu-x86 [ manyargs dload ptables ]
compiled 2013-03-12 on aeryn.xorinia.dim (Darwin)
; loading /home/asau/.csirc ...
; loading /usr/pkg/lib/chicke