[plt-dev] remf in unstable/list

From: Eli Barzilay (eli at barzilay.org)
Date: Thu May 27 15:44:18 EDT 2010

On May 27, David Van Horn wrote:
> On 5/27/10 2:47 PM, Eli Barzilay wrote:
> >> I think remf is useful since it is an abstraction of remove,
> >> remv, remq, etc., and including it is consistent with findf,
> >> memf, and assf.
> >
> > IMO, `findf', `memf', and `assf' are expected to return only the
> > first, but `remf' isn't.  Practically all of my interaction with
> > the `mem...' functions had two problems: (a) surprising me with
> > the fact that the non-*ed versions remove only the first, (b)
> > annoying me with lumping the remove-all functionality with a
> > list-of-values input, which in almost all cases makes me end up
> > with a (remv* (list x) l).
> 
> Are you opposed to having the function, or just to having it called
> `remf'?

I guess that a better alternative would be to have a name that clearly
indicates that it's removing only the first match -- but the same
argument holds for the other first-only `rem...'s.  This would avoid
the (a) above.  (b) is harder to deal with.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the dev mailing list.