[plt-scheme] A macro for declaring class properties, a question

From: David Einstein (deinst at gmail.com)
Date: Thu Oct 18 10:12:30 EDT 2007

On 10/18/07, Grant Rettke <grettke at acm.org> wrote:
>
> On 10/18/07, Noel Welsh <noelwelsh at gmail.com> wrote:
> > Something like this would do:
> >
> > (define-syntax property
> >   (syntax-rules ()
> >     [(_ name)
> >      (begin (field super-secret-field-name)
> >             (define/public name
> >               (case-lambda
> >                 [() super-secret-field-name]
> >                 [(value) (set! super-secret-field-name value)])))]))
>
> I'm confused about the hygiene here. Wouldn't the class end up having
> duplicate field names 'super-secret-field-name', or are those made
> clean when referenced by the class?


Probably the best introduction to what is going on here is in

JRM's Syntax-rules Primer for the Merely Eccentric at
http://www.xs4all.nl/~hipster/lib/scheme/gauche/define-syntax-primer.txt





_________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20071018/ecdcd17c/attachment.html>

Posted on the users mailing list.