[CM] [Rudolf Adamkovič] s7 cannot not find a member of a list

Rudolf Adamkovič salutis at me.com
Tue Nov 29 03:39:12 PST 2022


Without further ado, using s7:


   λ (define-record-type <foo> (make-foo) foo?)

we get

   λ (equal? (make-foo) (make-foo))

as expected.  But

   λ (member (make-foo) (list (make-foo)))

which violates the R7RS requirement

   [...] `member' uses `compare', if given, and `equal?' otherwise.

As a side note,

   λ (member (make-foo) (list (make-foo)) equal?)
   ((inlet '{gensym}-1 <foo>))

as expected.

"Programming reliably -- must be an activity of an undeniably
mathematical nature […] You see, mathematics is about thinking, and
doing mathematics is always trying to think as well as possible."
-- Edsger W. Dijkstra, 1981

Rudolf Adamkovič <salutis at me.com> [he/him]
Studenohorská 25
84103 Bratislava

More information about the Cmdist mailing list