[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] understanding eval
From: |
Daishi Kato |
Subject: |
Re: [Chicken-users] understanding eval |
Date: |
Fri, 22 Feb 2008 21:57:42 +0900 |
User-agent: |
Wanderlust/2.15.5 (Almost Unreal) Emacs/21.4 Mule/5.0 (SAKAKI) |
OK, so that was stupid.
How about this?
(define a 'values)
(define b '((1 2 3) #(4 5 6))
I'd like to evaluate (values '(1 2 3) '#(4 5 6))
using eval, a and b.
--daishi
At Fri, 22 Feb 2008 13:29:55 +0100,
Peter Bex wrote:
> 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