[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Recursive define-macro
From: |
felix winkelmann |
Subject: |
Re: [Chicken-users] Recursive define-macro |
Date: |
Wed, 7 Mar 2007 09:37:44 +0100 |
On 3/7/07, Joshua Griffith <address@hidden> wrote:
I get an unbound variable error when I execute the following:
(define-macro (test alist) (if (> 0 (length alist)) (test (cdr alist))))
Are recursive define-macro definitions possible?
The code inside a macro is executed at macro-expansion time,
and should probably not refer to itself for expansion. A macro
can be recursive by *expanding* into code that refers to the macro
(but that might end in endless recursion).
cheers,
felix