chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Another define bug and a question


From: felix winkelmann
Subject: Re: [Chicken-users] Another define bug and a question
Date: Wed, 8 Jun 2005 12:54:56 +0200

On 6/8/05, Reed Sheridan <address@hidden> wrote:
> On 6/7/05, felix winkelmann <address@hidden> wrote:
> >
> > Macros and procedures live in a different namespace in the
> > low-level macro system. The example above is simply wrong,
> > but admittedly the error message could be improved.
> 
> I don't quite understand.  I thought we only had one namespace in
> Scheme, and I was expecting foo to be set to 1, which is in fact what
> happens if you use the -hygienic flag.  To make it more clear, what
> would a better error message say?
> 

I probably misused the term namespace here: Macros and variables
(or syntax and non-syntax) are completely distinct and there can exist
a variable and a macro of the same name (at least as it is currently
implemented in Chicken's low-level macro system - which isn't particularly
exotic). psyntax (syntax-case) uses a stricter system. Moreover syntax
exists at compile-time, but non-syntactic variables exist at runtime.

For example, what should be the result of:

(define foo (read))
(define-syntax bar foo)     ; probably not legal, but this should show
the conceptual difference.


?

Better error handling would be to signal that a syntactic and a non-syntactic
entity of the same name is used.

> 
> %char->latin1 is not hidden like it should be, due to a typo in the
> declarations, but I don't understand how that could cause this to
> happen.
> 

Compiler optimizations, overly eager declarations and (again) 
missing error checks. I have fixed this (and added several error-checks 
to srfi-14.scm).


cheers,
felix




reply via email to

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