Subject: Re: novice: mapcan use?
From: rpw3@rpw3.org (Rob Warnock)
Date: Sun, 28 Aug 2005 23:03:15 -0500
Newsgroups: comp.lang.lisp
Message-ID: <XsudnV8dGZGeFI_eRVn-gw@speakeasy.net>
Bernd Schmitt  <Bernd.Schmitt.News@gmx.net> wrote:
+---------------
| Pascal Costanza wrote:
| > However, mapcan is somewhat old-fashioned. It's especially odd that the 
| > filtering function has to return the elements wrapped in lists.
| > It's clearer (IMHO) to use, for example, the LOOP macro instead:
| > (loop for x in '(a 2 b c 3 4 d 5)
| >       when (numberp x)
| >       collect x)
| 
| Ok. Loop is 90 pages away ...
+---------------

O.k, try this then:   ;-}  ;-}

    > (remove-if-not #'numberp '(a 2 b c 3 4 d 5))

    (2 3 4 5)
    > 

+---------------
| But as i see in the index, there is no collect ...
+---------------

The COLLECT above is a "loop keyword". Don't worry about it until
you start studying LOOP for real...


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607