[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Help solving this phasing problem.
From: |
Peter Bex |
Subject: |
Re: [Chicken-users] Help solving this phasing problem. |
Date: |
Sun, 13 Feb 2011 14:08:24 +0100 |
User-agent: |
Mutt/1.4.2.3i |
On Sun, Feb 13, 2011 at 01:59:47PM +0100, Felix wrote:
> > This imports module-a (which can be internal and nobody has to know it's
> > there) both for syntax and normally, and then re-exports the convenience
> > function.
> >
> > Yes, this is ugly.
>
> Well, is it?
Not having an alternative doesn't make it less ugly ;)
> What could be an alternative? Perhaps something like
>
> (define-syntax begin-<yes...what?>
> (syntax-rules ()
> ((_ forms ...)
> (begin
> (begin-for-syntax forms ...)
> forms ...))))
begin-also-for-syntax? begin-for-both-environments? :)
Maybe we should have a different define form that allows
you to add things to both the expansion and macro definition
environments. Or maybe simpler: add a special form that "lifts"
a definition to the macro definition environment.
So you'd do something like
(define foo 1)
(add-to-syntax-env foo)
Cheers,
Peter
--
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
is especially attractive, not only because it can be economically
and scientifically rewarding, but also because it can be an aesthetic
experience much like composing poetry or music."
-- Donald Knuth