[plt-scheme] Custom expansion and certificates

From: Neil Toronto (ntoronto at cs.byu.edu)
Date: Sun Mar 14 18:11:32 EDT 2010

Matthew Flatt wrote:
>  (define-for-syntax (recertifiable-transform transform stx)
>    (let ([new-stx (transform stx)]
>          [inspector (current-code-inspector)])
>      (define (recertify s) (syntax-recertify s new-stx inspector #f))
>      (values new-stx recertify)))

This clears things up a bit.

Is having a constant inspector in recertify observably different than 
applying current-code-inspector within it?

> I can see why you're trying to use `make-syntax-introducer' and
> `certifier', but those don't really work with `local-expand'. They're
> intended for cases where you're writing your own kind of macro expander
> that looks up its own kind of transformer bindings and installs it own
> marks and certificates while applying those transformers.

Ah, okay. My larger project involves a different kind of macro 
expansion, so I do need to introduce syntax marks and such. Good to know.

Last question: Why do 'match' and 'for' mark the syntax twice, with 
syntax-local-introduce on the outside?


Neil T

Posted on the users mailing list.