chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] compiling with svn revision 12496


From: F. Wittenberger
Subject: Re: [Chicken-users] compiling with svn revision 12496
Date: Mon, 17 Nov 2008 15:04:39 +0100

Am Montag, den 17.11.2008, 14:04 +0100 schrieb felix winkelmann:
> On Sat, Nov 15, 2008 at 3:05 PM, Jörg F. Wittenberger
> <address@hidden> wrote:
> >
> > There's code, which maps "symbol-append"+"string-append" over input
> > forms to ease typing.  (The openssl.scm - not even my code.)  I have no
> > idea how to fix that with hygienic macros.  And nothing of the trick is
> > supposed to be visible after compilation.  Hence chicken should litter
> > an .import.scm with those internals up to breaking compilation
> > altogether.
> >
> 
> Then the code nees to be fixed. Currently, all syntax-definitions
> must be included in the import library, in case an exported macro
> refers to any of the internal syntax definitions (I checked in something
> today, to omit this list at least when no syntax is exported).

Thanks!  That might be already enough to get around.

> The hygienic macro system introduces a new concept into macro-
> writing: that a symbol doesn't necessarily always have the same syntactic
> meaning.

But how did it work last week?

Here is a good example of what it going wrong.  Maybe it makes things
easier.

I picked the idiom of define-macro from somewhere in the source tree and
then removed the "strip-syntax" after your, Felix's, comment:

(define-syntax define-macro
  (syntax-rules ()
    ((_ (name . llist) body ...)
     (define-syntax name
       (lambda (x r c)
         (apply (lambda llist body ...) (cdr x)))))
    ((_ name . body)
     (define-syntax name
       (lambda (x r c) (cdr x))))))

To make some code work, I used a supposedly very local macro:

(define-macro (end-of-file) #!eof)

Last week: no problem.  This week:

Error: during expansion of (import ...) - unreadable object in line 240

I found in the .import.scm:

(cons 'end-of-file
              (lambda4612
                (x4613 r4614 c4615)
                (apply4616 (lambda4612 () #<eof>) (cdr4617 x4613)))))
                                         ^^^^^^^^^
                                         smells suspect to me

When removed, compilation continues.

>  This will make it harder to hack around hygiene, but that
> is a good thing.

A agree.  That is: in principle.  But when the cost of transition is
killing me, I might change my mind.  ;-)




reply via email to

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