chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] understanding eval


From: Peter Bex
Subject: Re: [Chicken-users] understanding eval
Date: Fri, 22 Feb 2008 13:29:55 +0100
User-agent: Mutt/1.4.2.3i

On Fri, Feb 22, 2008 at 09:22:36PM +0900, Daishi Kato wrote:
> Hi,
> 
> This might be a stupid question,
> but would someone help me understand the following eval example?
> I was expecting to get 1.

You're evaluating (car (1 2 3))
You want to be evaluating (car (list 1 2 3)) or (car (quote (1 2 3)))

> 8<------8<------8<------8<------8<------8<------8<------8<------
> 
> CHICKEN
> Version 2.732 - linux-unix-gnu-x86      [ manyargs dload ptables applyhook 
> cross ]
> (c)2000-2007 Felix L. Winkelmann        compiled 2007-12-04 on spirits (Linux)
> 
> #;1> (define a 'car)
> #;2> (define b '(1 2 3))
> #;3> (eval (list a b))
> Error: call of non-procedure: 1
> 
>         Call history:
> 
>         <syntax>                (eval (list a b))
>         <syntax>                (list a b)
>         <eval>          (eval (list a b))
>         <eval>          (list a b)
>         <syntax>                (car (1 2 3))
>         <syntax>                (1 2 3)
>         <eval>          (car (1 2 3))
>         <eval>          (1 2 3) <--

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth

Attachment: pgp3fcJNO4CR0.pgp
Description: PGP signature


reply via email to

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