[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: building other EQUIV?-like predicates



On 3/10/06, Sebastian Egner <sebastian.egner@xxxxxxxxxxx> 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