[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


Howdy!

Without further ado, using s7:

Given

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

we get

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

as expected.  But

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

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.

Rudy
-- 
"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
Slovakia



More information about the Cmdist mailing list