You are looking at historical revision 40249 of this page. It may differ significantly from its current revision.

define-record and srfi-17

Regular define-record records don't support generalized set. This macro implements support for binding to srfi-17.

(define-syntax define-gs-record
  (er-macro-transformer
   (lambda (x r c)
     (let ((type (cadr x))
           (fields (cddr x))
           (%begin (r 'begin))
           (%define-record (r 'define-record))
           (%define (r 'define))
           (%getter-with-setter (r 'getter-with-setter)))
       `(,%begin
         (,%define-record ,type ,@fields)
         ,@(map (lambda (f)
                  (let* ((getter (string->symbol
                                  (string-append
                                   (symbol->string
                                    (strip-syntax type))
                                   "-"
                                   (symbol->string
                                    (strip-syntax f)))))
                         (setter (string->symbol
                                  (string-append
                                   (symbol->string
                                    (strip-syntax getter))
                                   "-set!"))))
                    (list %define
                          getter
                          (list %getter-with-setter getter setter))))
                fields))))))

now you can say

(define-gs-record test a b c)

(define t (make-test 1 2 3))
(set! (test-a t) 'new-val)