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

From: Grant Rettke (grettke at acm.org)
Date: Thu Oct 18 12:23:50 EDT 2007

On 10/18/07, Matthias Felleisen <matthias at ccs.neu.edu> wrote:
> No. See macro-stepper.

I got an error "class*: duplicate declared external field name in:

when I tried the following:

(module test mzscheme

  (require (lib "class.ss"))

  (provide (all-defined))

  (define-syntax property
    (syntax-rules ()
      [(_ name)
         (field (super-secret-field-name null))
         (define/public name
             [() super-secret-field-name]
             [(value) (set! super-secret-field-name value)])))]))

  (define service-call%
    (class* object% ()
      (property customer-name)
      (property customer-id)

Posted on the users mailing list.