Rob Browning <r...@defaultvalue.org> skribis: > This crashes in 2.0: > > (use-modules (srfi srfi-9 gnu)) > > (define-immutable-record-type foo > (foo x) > foo? > (x x)) > > (foo 1) > > like this: > > foo.scm:10:9: In procedure #<procedure 131fd00 ()>: > foo.scm:10:9: In procedure make-struct: Wrong type argument in position 1: > #<procedure %foo-procedure (x)> > > Changing the type name to <foo> (or even xfoo) fixes the conflict, even > though "define-immutable-type foo" actually creates a binding for <foo>, > not foo.
This is expected. The macro, like that of SRFI-9, creates one binding for the record-type descriptor, one for the constructor, one for the predicate, and one for the accessor. Since the first two have the same name, it Doesn’t Work. The convention is indeed to use <foo> for the RTD. HTH, Ludo’.