a #SRFI from 02022 that reconciles #Scheme #records from R6RS and R7RS.
on 02023-07-09The #Common-Lisp approach to defining #records is that after you (defstruct point x y) you can (let ((p (make-point :x 3 :y 4))) (setf (point-x p) 5) p) which prints as #S(POINT :X 5 :Y 4), which is also valid read syntax. There are of course optional keyword arguments to override every part of this.
evidently #R7RS #Scheme adopted SRFI-9 #records!
on 02023-07-09#SRFI 131 for #Scheme is Cowan and Clinger’s 02015 reduction of SRFI 99 to be implementable with only syntax-rules and not a more powerful macro system. #records
#SRFI 99 for #Scheme is Clinger’s 02008 simpler alternative to the appalling R6RS record system in SRFI 76, with a syntactic layer that is an extension of SRFI 9. This is ERR5RS-compatible. Note that Clinger’s name is also on SRFI 76! #records
on 02023-07-09#SRFI 76 for #Scheme is the 02005 proposal for R6RS #records, by Clinger, Dybvig, Sperber and van Straaten (based on Pavel Curtis’s 01989 proposal, Bill Rozas’s work, Norman Adams’s work, T, CScheme, etc.), which was withdrawn as previously planned when R6RS was done. It mentions that PLT Scheme (Racket) allows (define-struct point (x y)), but it doesn’t. All the examples in the “examples” section are too horrific to repeat here.
#SRFI 57 for #Scheme is van Tonder’s 02004 approach to defining #records, extending SRFI 9, permitting abbreviated syntax (define-record-type node (make-node left right)), which I’m not sure defines left and right functions.
#SRFI 9 for #Scheme is Kelsey’s 01999 approach to defining #records. “Each new record type is distinct from all existing types, including other record types and Scheme’s predefined types.” Given (define-record-type :pare (kons x y) pare? (x kar set-kar!) (y kdr)) you have functions pare?, kons, kar, kdr, and set-kar!.