[racket-dev] syntax taints instead of syntax certificates

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Sat Jul 2 12:03:07 EDT 2011

On Thu, Jun 30, 2011 at 2:20 PM, Stephan Houben <stephanh at planet.nl> wrote:
> Something like this springs to mind:
> (define-syntax provide/protection
>  (syntax-rules ()
>    ((_ name)
>     (begin
>       (define-syntax tmp
>         (syntax-rules ()
>           ((_ . args) (name . args))))
>       (provide (rename-out (tmp name)))))))
> If I understand correctly then
> (provide/protection mymacro)
> would automatically wrap mymacro and export it
> (by virtue of redirecting the transformation through syntax-rules).

Oh, excellent.  That should be straightforward enough.  Then we have
provide/contract for values and provide/protect for macros, and all
invariants are protected.  :D

> May I suggest the following introduction for the documentation?
> "Nice macros you have here. Would be a pity if ... something
> happened to them. But we can provide... protection."
... said Matthew menacingly.  Stephan watched with a growing sense of
dread as Matthew's "enforcer" Ryan picked up a carefully placed
identifier and threw it into an unsafe context.


Posted on the dev mailing list.