[plt-scheme] Custom expansion and certificates
I've attached one of the smallest examples producing "access from an
uncertified context to unexported variable". It's caused by rebuilding
custom-expanded syntax that contains unexported identifiers.
Okay, it *would* be one of the smallest examples except it contains my
non-working half-cargo-cult solution. I arrived at it by trying to get
at the meaning of the solutions in match's pattern parser and for's
sequence transformer expander. All *I* want to do is rebuild syntax
lists, perhaps with a couple of macro calls inserted. The attached code
only tries to rebuild.
I think I have the main idea: put syntax marks on, then transform, then
have a local certifier put the old certificates on the marked objects.
My questions:
- Why syntax-local-introduce first? Does that remove the marks of the
most recent expansion? Can syntax have only one mark at a time?
- Why undo the new marks before applying the local certifier?
- How deep is the local certifier's recursion?
- When am I losing the certificates? In syntax->list or datum->syntax?
- Why doesn't the match's pattern expander use syntax-recertify, when
the sequence transformer expander does?
- Why use an inactive vs. an active certifier?
I think what would be most helpful is a very small working example.
Those in match and for are way too complicated to fit in my head.
Is it possible there's a nice syntax/loc sort of solution for simple
cases like this, or even cases involving deep restructuring?
Neil T
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: expandify.ss
URL: <http://lists.racket-lang.org/users/archive/attachments/20100313/00f97b00/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: expandify-test.ss
URL: <http://lists.racket-lang.org/users/archive/attachments/20100313/00f97b00/attachment-0001.ksh>