[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: Sat, 12 Feb 2011 22:51:05 +0100
User-agent: Mutt/

On Sat, Feb 12, 2011 at 04:35:23PM -0500, Patrick Li wrote:
> I have a *very* ugly workaround right now.
> I define the convenience function twice. Once normally. And again within a
> begin-for-syntax form.

You can do the same trick as before:

(module module-a (convenience-function)
  (import chicken scheme)

  (define (convenience-function)
    (display "do convenience things\n")))

(module module-b (my-macro convenience-function)
  (import chicken scheme module-a)
  (import-for-syntax module-a)
  (define-syntax my-macro
    (lambda (expression rename comparison)
       "My Macro Output")))

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

Yes, this is ugly.

"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

reply via email to

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