From: Jean-Louis Leroy
Subject: The Archeology of Lisp (name this function)
Date: 
Message-ID: <m31z01rv1t.fsf@enterprise.newedgeconcept>
From my first encounter with Lisp 15 years ago, I would have *sworn*
that it came with the equivalent of Perl's grep {} operator, iow:

(defun select (pred alist)
  (mapcan #'(lambda (el)
	      (and (funcall pred el) (list el)))
	  alist))

Did I dream? Did it do so little it didn't make it into the standard?
Then what was it called again?
-- 
Jean-Louis Leroy
http://users.skynet.be/jll

From: Johan Kullstam
Subject: Re: The Archeology of Lisp (name this function)
Date: 
Message-ID: <m3ittdte48.fsf@sysengr.res.ray.com>
Jean-Louis Leroy <···@skynet.be> writes:

> From my first encounter with Lisp 15 years ago, I would have *sworn*
> that it came with the equivalent of Perl's grep {} operator, iow:
> 
> (defun select (pred alist)
>   (mapcan #'(lambda (el)
> 	      (and (funcall pred el) (list el)))
> 	  alist))
> 
> Did I dream? Did it do so little it didn't make it into the standard?
> Then what was it called again?

this looks an awful lot like REMOVE-IF-NOT.

[i'd have prefered the name KEEP-IF (and NKEEP-IF for non-consing
variant) but who am i?]

-- 
J o h a n  K u l l s t a m
[········@ne.mediaone.net]
sysengr
From: Francis Leboutte
Subject: Re: The Archeology of Lisp (name this function)
Date: 
Message-ID: <rcgtoscbs5b8ujdj0154b3677h683ndi3g@4ax.com>
Johan Kullstam <········@ne.mediaone.net> wrote:

>Jean-Louis Leroy <···@skynet.be> writes:
>
>> From my first encounter with Lisp 15 years ago, I would have *sworn*
>> that it came with the equivalent of Perl's grep {} operator, iow:
>> 
>> (defun select (pred alist)
>>   (mapcan #'(lambda (el)
>> 	      (and (funcall pred el) (list el)))
>> 	  alist))
>> 
>> Did I dream? Did it do so little it didn't make it into the standard?
>> Then what was it called again?
>
>this looks an awful lot like REMOVE-IF-NOT.
>

Would say like filter :

(defun filter (fn list)
   (loop for x in list
     when (funcall fn x)
     collect x))
--
Francis Leboutte
··@algo.be   www.algo.be   +32-(0)4.388.39.19
From: Jean-Louis Leroy
Subject: Re: The Archeology of Lisp (name this function)
Date: 
Message-ID: <m3g0oh57aw.fsf@enterprise.newedgeconcept>
Johan Kullstam <········@ne.mediaone.net> writes:

> > (defun select (pred alist)
> >   (mapcan #'(lambda (el)
> > 	      (and (funcall pred el) (list el)))
> > 	  alist))
> > 
> > Did I dream? Did it do so little it didn't make it into the standard?
> > Then what was it called again?
> 
> this looks an awful lot like REMOVE-IF-NOT.

Yesss! Funny, I knew about remove-if-not but I was confused by the
double negation it seems <g>
-- 
Jean-Louis Leroy
http://users.skynet.be/jll
From: Daniel Barlow
Subject: Re: The Archeology of Lisp (name this function)
Date: 
Message-ID: <878zu9fbxb.fsf@tninkpad.telent.net>
Jean-Louis Leroy <···@skynet.be> writes:

> From my first encounter with Lisp 15 years ago, I would have *sworn*
> that it came with the equivalent of Perl's grep {} operator, iow:

REMOVE-IF-NOT ?  Or DELETE-IF-NOT, if you can live with possible
destructiveness.


-dan

-- 
  http://ww.telent.net/cliki/ - CLiki: CL/Unix free software link farm