chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Re: understanding eval


From: Ivan Shmakov
Subject: [Chicken-users] Re: understanding eval
Date: Fri, 22 Feb 2008 18:34:10 +0600
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

>>>>> Daishi Kato <address@hidden> writes:

 > Hi, This might be a stupid question, but would someone help me
 > understand the following eval example?  I was expecting to get 1.

[...]

 > #;1> (define a 'car)
 > #;2> (define b '(1 2 3))
 > #;3> (eval (list a b))
 > Error: call of non-procedure: 1

        Well, since (list a b) is '(car (1 2 3)), you're trying to
        evaluate: (car (1 2 3)).  Surely you didn't mean (car '(1 2 3))
        == (car (quote (1 2 3)))?

#;1> (car '(1 2 3))
1
#;2> (let ((a 'car)
           (b '(1 2 3)))
        (eval (list a (list 'quote b))))
1
#;3> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]