#|Hello all, <br><br>I'm looking to define a macro that extends the forms within a racket/class class%. In particular, I would like a form to define a C# like class language form property, that implements the getters and setters for an initialized field automatically. <br>
<br>I'm guessing that someone has written this before however. Can anyone assist with macros that expand into class fields and methods? Ideally, I'd like to move to syntax-parse. |#<br><br>(define-syntax (define-property syntax)<br>
(syntax-parse syntax<br> [((~literal define-property) name:id init-value)<br> <br> #'(define name init-value)<br> (define/public (set-name! init-value)<br>
(set! name init-value))<br> (define/public (get-name)<br> name)]))<br>><br>define/public: use of a class keyword is not in a class top-level in: (define/public (set-name! init-value) (set! name init-value))<br>