chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] compile-time eval-time mismatch


From: Michele Simionato
Subject: Re: [Chicken-users] compile-time eval-time mismatch
Date: Wed, 8 Dec 2004 05:33:47 -0500

On Wed, 8 Dec 2004 10:06:53 +0100, felix winkelmann <address@hidden> wrote:
> The eval-when form provides three different situations in which
> to evaluate a form:
> 
> 1) compile/macroexpansion time  ('compile')
> 2) eval/interpretation time ('eval')
> 3) run-time ("load")
> 
> Just change your eval-when form to:
> 
> (eval-when (compile eval load) ...)
> 
> cheers,
> felix
> 

Thanks Felix, I think this is the THIRD time I ask you about eval-when.
For same reason, I cannot get my mind around it. I also made you to
change the documentation, but still it is not 100% clear to me how to
use it.
For instance, now I understand why

(eval-when
 (compile eval load)
 
 (define (chatty ls)
   (print "macro called with args " ls)
   ls))

(define-macro (mac . args)
  (chatty
  `(chatty ',args)))

(print (mac 1 2))

works only with the "load" option (BTW, "load" is the most confusing name
one can imagine) but I still I do not understand why
 
(eval-when
  (compile eval)
  (define (make-macro name)
    (eval `(define-macro (,name x) x)))
  (make-macro 'identity-macro) )

(display (identity-macro 2))

does NOT work if I give the "load" option [with an absolutely
misterious error message :-(].

Why it has to be so cumbersome??


       Michele




reply via email to

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