chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] cond-expand and syntax-rules on Chicken 4


From: Alex Shinn
Subject: Re: [Chicken-hackers] cond-expand and syntax-rules on Chicken 4
Date: Fri, 20 Nov 2009 13:40:25 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Thomas Bushnell BSG <address@hidden> writes:

> This is inconsistent with the behavior of syntax-rules as documented by
> srfi 5, and has the effect of making it essentially impossible to have
> macros which expand to cond-expand tests that check
> compile time.

What does SRFI-5 have to do with syntax-rules?

> I can work around it by putting the cond-expand outside the syntax rules
> to set a variable, and then testing that variable inside the
> syntax-rules.  But still, this is a bug--or at least, a serious
> difference in intepretation.  I think it's a clear bug.  It should be
> possible to have syntax-rules expand to *any* form, including a
> cond-expand form.  It is wrong for the evaluator to get in and evaluate
> the cond-expand during macro-definition time.

I think it's certainly odd - I can't imagine why that's
happening - but I'm not sure you can call it a bug in the
strictest sense.  SRFI-0 restricts cond-expand forms to the
"top-level," and while it doesn't make it clear whether that
includes macro expansions at the top-level, the rationale of
the restriction (to allow static analysis and facilitate
reading and understanding of programs) suggests that such
uses are illegal.

-- 
Alex




reply via email to

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