Re: building other EQUIV?-like predicates
Alex Shinn 11 Mar 2006 03:02 UTC
On 3/10/06, Sebastian Egner <xxxxxx@philips.com> wrote:
>
> In many cases I need an application-specific
> equivalence which is not among the predefined
> ones.
This is true, the equivalence of leaf nodes does seem on
the ad-hoc side. Although a SELECT-EQUIV? might make
sense for SRFI-67, I don't think it fits well into this SRFI.
A simpler extension is to provide an optional equivalence
predicate argument as in SRFI-1's MEMBER and ASSOC:
(equiv? obj1 obj2 [eq-fn])
where EQ-FN defaults to something like
(lambda (a b)
(if (string? a) (and (string? b) (string=? a b)) (eqv? a b))
--
Alex