[r6rs-discuss] [Formal] FIND delivers an ambiguous value

From: Eli Barzilay <eli>
Date: Wed Nov 1 14:17:41 2006

On Nov 1, Shiro Kawai wrote:
> From: Andre van Tonder <andre_at_het.brown.edu>
> Subject: Re: [r6rs-discuss] [Formal] FIND delivers an ambiguous value
> Date: Wed, 1 Nov 2006 14:07:31 -0500 (EST)
>
> > On Wed, 1 Nov 2006, Nils M Holm wrote:
> >
> > > Proposed improvement: return the tail of the sublist beginning
> > > with the first member satisfying the predicate:
> >
> > This is clearly the right way of doing it. But since then
> >
> > find = memp
> >
> > I would argue for dropping find altogether.
>
> In my view, 'find' is just a convenience procedure trading
> accuracy (about #f as element). Despite of the problem
> Nils pointed out, I use 'find' a lot more than 'member'-type
> procedures, because most of the time I know what I'm going
> to find is not #f. I think it captures a common use case
> and worth to have it.
>
> However, if the issue really matters, another way to address
> it is to make find take an optional argument, defaulted to #f,
> which will be retruned in case 'find' doesn't find the item.
>
> (find not '(#t) 'not-found) => not-found
> (find not '(#f) 'not-found) => #f

add1

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!
Received on Wed Nov 01 2006 - 14:17:34 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:00 UTC