Dear Jim,

thank you very much for looking at this SRFI so attentively. In fact, there is an error in the current sample implementation; it doesn't match the specification correctly (a constructor #f is implemented as a constructor consisting of an integer, which is wrong).

Thus, I have corrected the sample implementation.

Arthur, I opened a pull request for the SRFI 136 repo. It incorporates the corrections of the sample implementation and a number of minor suggestions that were previously made on the mailing list.

If no one objects, I wouldn't mind to call this a final draft.

Marc 

Jim Rees <xxxxxx@gmail.com> schrieb am Mi., 7. Dez. 2016 um 19:14 Uhr:
So, I just wrote my own "cleanroom" version of srfi-136 as a laborious - but very gratifying - exercise.  It's not useful as another reference as it's chock-full of non-portable internals from my system.

I borrowed the tests from the sample implementation, and added a few more as I was coding some corner cases.  The following forms fail in expansion on the sample implementation.  I double-checked them on chibi to make sure the failures weren't caused by some bug in my own syntax-rules:

;; middle record type has no constructor, and 2 or more fields
(let ()
(define-record-type <base> (make-base) base?)
(define-record-type (<middle> <base>) #f middle? (a middle-a middle-a-set!) (b middle-b middle-b-set!))
(define-record-type (<leaf> <middle>) (make-leaf d) leaf? (d leaf-d))
'ok)

;; type with unnamed field and no constructor
(let () (define-record-type <simple> #f simple? (#f foo set-foo!)) 'ok)


Pedantic nit:

"Furthermore, the macro use (<type name>) macro-expands into an object that serves as a runtime record-type descriptor for the procedural interface (see below)."

should be "...macro-expands into an expression that evaluates to an object that serves ..."

-jim

To unsubscribe from this list please goto http://www.simplelists.com/confirm.php?u=6GNcf4uDlvn3bUuwvrqorjunSxFDO5L0