[racket-dev] Running into phase-error issues

From: Danny Yoo (dyoo at cs.wpi.edu)
Date: Sun Aug 14 23:32:48 EDT 2011

>> I'm running into some problem when using dynamic-require-for-syntax:
>
> I imagine the problem is that `dynamic-require-for-syntax' is broken,
> but I hope to get rid of that function because it implements bad
> phase-crossing behavior.
>
> So, although it doesn't directly address the problem, can you say more
> about why you want to use `dynamic-require-for-syntax'?
>


Yes!  Here's the problem I'm trying to solve:  I'm trying to attach
information to a module, and then be able to query for that
information without running the module.  I'm basically trying to
implement:

    http://hashcollision.org/whalesong/#(part._.Including_external_resources_with__planet_dyoo_whalesong_1_2_resource_)


I'm approaching this problem by:

   * attaching that information as a compile-time begin-for-syntax.

   * querying for that information with a a dynamic-require-for-syntax
to invoke the begin-for-syntax.


As an implementation of this, see the files in:

   https://github.com/dyoo/whalesong/blob/master/resource/

I'm working around the bug by avoiding the require
(https://github.com/dyoo/whalesong/commit/e6547a9aa21402646814f562da6ba99b16a585a0),
but this is certainly fragile.

I want to do the Right Thing, but I don't know how yet.  :)


Posted on the dev mailing list.