Sun Mar 20 12:54:43 EDT 2011

Is `syntax->list' the culprit?

From [1]: "Calling syntax->list loses the outermost certificate, which
is the "safest" place to have one. IOW, syntax->list causes the error
when one of its immediate subexpressions is an introduced, unexported

Following up to [2]:

(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)))

The non-osdir thread: [3].

Following up on the idea that the problem might be `syntax->list' I
tried the following to replace the invokation in `rpn-syntax-rules',
which seems to work:

(define (syntax->rlist stx)
  (let* ((cci (current-code-inspector))
         (recert (lambda (stx-new)
                   (syntax-recertify stx-new stx cci #f))))
    (map recert (syntax->list stx))))

Next to that, there is another problem with `datum->syntax'.  Looks
like the reason I couln't get anywhere before is that it was wrong in
at least two places.

Another place that caused trouble was `make-rpn-expand-transformer'.
Here the certificate needs to come from the result of

Another one (damn!) is mf:alloc.  Tried for a bit to see what's going
on but I'm running out of steam.  This is horrible.

[1] http://osdir.com/ml/plt-scheme/2010-03/msg00245.html
[2] http://osdir.com/ml/plt-scheme/2010-03/msg00247.html
[3] http://lists.racket-lang.org/users/archive/2010-March/038586.html