[plt-scheme] find-method/who
Matthew Flatt writes:
> At Wed, 9 Mar 2005 20:46:55 -0500, Doug Orleans wrote:
> > >
> > > If you're writing a program-processing tool, you'll need to recertify
> > > expressions that you assemble from pieces of pulled-apart expressions.
> > > Or, if you don't care about discarding the enforcement power of
> > > certificates, you can just recertify every expression as soon as you
> > > extract it from an enclosing expression.
> >
> > OK, I think I'm starting to grok this, but I'm not sure if I'm doing
> > the recertify correctly. Should I be using `syntax-recertify', or
> > `syntax-local-recertifier', or both?
>
> If you're writing a program processor, use `syntax-recertify'. The
> `syntax-local-recertifier' procedure is for macros.
By "program processor" do you just mean a procedure that operates on
syntax objects? When if I have a macro that uses a program processor?
> > What should
> > I use as the inspector, `(current-code-inspector)'?
>
> Yes.
OK. I noticed that errortrace uses (current-inspector), is this a
signficant difference?
> > What do I use as
> > the certificate key? Can I just use #f?
>
> Yes.
>
> > Do you have an example of recertification?
>
> Not a small one, but there's errortrace and the "src2src.ss" part of mzc.
Thanks, I figured out what I was doing wrong; I'm pulling out
identifiers from a syntax object (the free variables of the
expression), and I have to recertify them with each enclosing
expression's syntax object, not just the top level one. (You can see
the code on SourceForge if you're morbidly curious:
http://cvs.sourceforge.net/viewcvs.py/socrates-lang/socrates/free-vars.ss?rev=1.4&view=auto
Tonight's check-in with the recertify fix should show up there in a few
hours. Suggestions for improvement are welcome.)
By the way, is there a way to inspect the certificates of a syntax
object directly? I'm not sure exactly what I'd do with them, but I'm
sort of thinking I should just ignore (i.e. hide) identifiers that the
client of my program processor can't access rather than blithely
recertifying them all. But I have no idea how to go about this, or
even whether it makes sense.
--dougo at place.org