[plt-scheme] paren-shape bug?

From: Dimitris Vyzovitis (vyzo at media.mit.edu)
Date: Wed Apr 29 18:18:37 EDT 2009

On Wed, 29 Apr 2009, Matthew Flatt wrote:

> So, `syntax/template' is now supposed to be the reusable and
> generalizable layer.
>
>
> Here's an example use of `syntax/template' to implements a
> `syntax/shape' form that preserves the 'paren-shape property:
>
>  (define-for-syntax (get-shape-prop stx)
>    (syntax-property stx 'paren-shape))
>
>  (define (add-shape-prop v stx datum)
>    (syntax-property (datum->syntax stx datum stx stx stx)
>                     'paren-shape
>                     v))
>
>  (define-syntax (syntax/shape stx)
>    (syntax-case stx ()
>      [(_ tmpl)
>       (transform-template #'tmpl
>                           #:save get-shape-prop
>                           #:restore-stx #'add-shape-prop)]))
>
>

Aah this is excellent! Thanks Matthew.

I'll keep my reader macro around, since its code is nice and simple, but I 
will convert my macro wrappers to use this [so that the reader macro can 
be disabled without breaking anything].

-- vyzo


Posted on the users mailing list.