I think what happens here is that the `require` that Konrad added was getting the correct state initialized, but because of hygiene wasn't the `require` that was binding the references to `foo`. Then Evan's changes meant that the state and the binding were coming from the correct place, and it works.
At least that's what I think is going on -- the interaction of the language position and syntax-time state still confuses me sometimes. Sam On Mon, Oct 27, 2014 at 4:43 AM, Konrad Hinsen <konrad.hin...@fastmail.net> wrote: > E. Moran writes: > > > Thanks for posting this... I was just wondering if you've considered > using the > > datum->syntax trick, yet. > > No, because this is the first time I hear about this! > > First of all, your code works fine under Racket 6.1 as well, which is good. > > Second, I don't quite understand how it works in detail, which is bad > - for me. It looks like it does the equivalent of adding (require > a-typed-lang/more) at the beginning of each module that uses > a-typed-lang. That's what I expected my original code to do as > well. Your comment points to the difference, which is somehow related > to the lexical context in which the (require ...) is placed. However, > understanding why this makes a difference seems to require a clearer > idea of how "require" works than I currently have. Is this documented > anywhere? > > > It'd maybe not be the most elegant solution, > > but it could at least serve to get things moving. > > Indeed. I'll update my repository with your working code and a pointer > to this thread. Thanks a lot! > > > (displayln (impersonator? foo)) > > A final question: after a quick look at the documentation for impersonators, > this looks like a check that foo is indeed the original function foo and > not something wrapped in a contract, right? > > Konrad. > ____________________ > Racket Users list: > http://lists.racket-lang.org/users ____________________ Racket Users list: http://lists.racket-lang.org/users