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: Thomas Bushnell BSG
Subject: Re: [Chicken-hackers] cond-expand and syntax-rules on Chicken 4
Date: Fri, 20 Nov 2009 10:07:35 -0800

On Fri, 2009-11-20 at 13:40 +0900, Alex Shinn wrote:
> 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?

That was a typo.  I meant to say R5RS.
.
> 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.

Chicken Scheme explicitly extends cond-expand outside top-level
contexts.  It's a documented feature of the system.

However, I think that it is certainly the case that syntax-rules should
behave correctly, and it's really a syntax-rules bug here, seemingly,
that keywords don't preserve their self-evaluating nature inside the
syntax-rules context, which, if the language is going to have them at
all, they should.

(For my part, I regard keywords as Common Lisp grot, and would be happy
to seem them abandoned, but I know I'm in the minority on that.)

Thomas






reply via email to

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