chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Help solving this phasing problem.


From: Patrick Li
Subject: Re: [Chicken-users] Help solving this phasing problem.
Date: Sat, 12 Feb 2011 17:34:44 -0500

Thanks Peter. That's perfectly good enough. As long as I'm not repeating myself and it's transparent to the user, I can live with it. You've been very helpful.
  -Patrick

On Sat, Feb 12, 2011 at 4:51 PM, Peter Bex <address@hidden> wrote:
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)
     (convenience-function)
      "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
function.

Yes, this is ugly.

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

_______________________________________________
Chicken-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/chicken-users


reply via email to

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