[gambit-list] (eval (cons func '(1 2))) don't work

andrew cooke andrew at acooke.org
Mon Aug 20 07:03:44 EDT 2007


[replying to list this time - realised my last example below is probably
what you intended]

it think it does work - the error seems reasonable to me.

what are you trying to do?

> (define (func x y) (+ x y))
> (eval (func 1 2))
3
1> (eval '(func 1 2))
3
> (eval `(func ,@'(1 2)))
3
1> (eval '(cons 4 (func 1 2)))
(4 . 3)
1> (eval (cons 'func '(1 2)))
3

(eval (func 1 2)) is (eval 3) which is 3
(eval '(func 1 2)) evaluates the quoted expression
(eval `(func ,@'(1 2))) is (eval '(func 1 2))
(eval (cons 'func '(1 2))) is (eval (func 1 2))

andrew





More information about the Gambit-list mailing list