[racket-dev] Running into phase-error issues
I've run into the same issue. The way I sometimes to it is to eval
code which requires the original module for syntax, extracts the value
during macro expansion, and produces an expression that quotes it (or
an expression that reconstructs it, if not an s-expression).
Carl Eastlund
On Sun, Aug 14, 2011 at 11:32 PM, Danny Yoo <dyoo at cs.wpi.edu> wrote:
>>> 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. :)
> _________________________________________________
> For list-related administrative tasks:
> http://lists.racket-lang.org/listinfo/dev
>