[plt-scheme] Combining scheme/serialize, structures, and macros?
The problem is that `identifier-binding' is relative to the module
currently being expanded. But `scheme/serialize' needs an
`identifer-binding' that is relative to the enclosing
`scheme/serialize' module instance.
Along the same lines, the `dynamic-require' in `scheme/serialize'
really should be in the same phase as the `scheme/serialize' instance.
The v4 namespace-anchor support is a step toward solving both of these
problem, but more is needed. I was just waiting for an example to add
that extra support --- and I hadn't noticed that we already have one.
Matthew
At Sat, 16 Feb 2008 20:16:34 -0500 (EST), Danny Yoo wrote:
> > I ran across a problem in one of my projects. I've distilled the
> > problem into a toy example, so hopefully someone can tell me what I'm
> > doing wrong.
> > :)
>
>
> I don't quite understand why, but the attached hack into
> scheme/serialize.ss makes things "work" for me.
>
> The issue seems hinged upon the fact that the deserialize-id that's
> attached to my serializing value has an identifier-transformer-binding
> rather than an identifier-binding in my constructed scenario... but I
> don't know why! There's some confusion on my end about the phases: I
> don't know the root cause of the problem.
>
> What I changed is from:
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> (let ([b (identifier-binding deserialize-id)]) ...)
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
> to a looser:
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> (let ([b (or (identifier-binding deserialize-id)
> (identifier-transformer-binding deserialize-id))]) ...
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
> I am pretty darn sure this is not the right fix, but maybe it will help
> someone more expert in figuring out what the ultimate cause of the issue
> is? With this hack, my test-compiler.ss's test-1 runs fine.
> ------------------------------------------------------------------------------
> [text/plain "serialize.ss.diff"] [save to ~/Desktop/ & open]
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme