[Top][All Lists]

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

[Chicken-users] Macros at runtime

From: Carlos Pita
Subject: [Chicken-users] Macros at runtime
Date: Wed, 6 Sep 2006 02:43:37 +0000 (GMT)

Hi all!

I've a strange problem when including macros from the
interpreter. For example, the file test.scm below runs
fine if csi first evals (use syntax-case) and then
includes it; but if csi directly includes the file
(which itself requires syntax-case), an error occurs: 

test.scm -------------

(use syntax-case)

(define-syntax sr-and
  (syntax-rules ()
    ((_) #t)
    ((_ e) e)
    ((_ e1 e2 e3 ...)
     (if e1 (and e2 e3 ...) #f))))

This fails -----------------

csi> (include "test")
; loading ...
; loading syntax-case-chicken-macros.scm ...
Error: illegal non-atomic object: ()

This not -------------------

csi> (use syntax-case)
; loading
; loading syntax-case-chicken-macros.scm ...
csi> (include "test")
csi> (sr-and 0 1)

I can't see what am I doing wrong. Also, as we are on
it, what is -run-time-macros supposed to do? The
documentation says "macros are made available at
run-time", but even when compiling with
-run-time-macros I can't expand sr-and from csi just
loading the .so (I have to include the .scm).

Thank you in advance.
Best regards,

Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!

reply via email to

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