Changeset 11027 in project


Ignore:
Timestamp:
06/16/08 23:55:31 (12 years ago)
Author:
svnwiki
Message:

Changes applied for Anonymous (89.58.165.202) through svnwiki:

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/define-record and srfi 17

    r2618 r11027  
    1 regular define-record records don't support genralized set. This macro implements support for binding to srfi-17.
     1regular define-record records don't support generalized set. This macro implements support for binding to srfi-17.
    22
    3 (define-macro (define-gs-record type . fields)
    4   `(begin
     3 (define-macro (define-gs-record type . fields)
     4   `(begin
    55     (define-record ,type ,@fields)
    66     ,@(map (lambda (f)
     
    1616               (list 'define getter (list 'getter-with-setter getter setter))))
    1717           fields)))
    18 
     18 
    1919(define-gs-record test a b c)
    2020
    2121now you can say
    22 (define t (make-test 1 2 3))
    23 (set! (test-a t) 'new-val)
     22
     23  (define t (make-test 1 2 3))
     24  (set! (test-a t) 'new-val)
Note: See TracChangeset for help on using the changeset viewer.