Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "B. Pym" Newsgroups: comp.lang.lisp Subject: Re: CAR/CDR vs FIRST/REST Date: Tue, 2 Jul 2024 21:33:23 -0000 (UTC) Organization: A noiseless patient Spider Lines: 14 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Injection-Date: Tue, 02 Jul 2024 23:33:23 +0200 (CEST) Injection-Info: dont-email.me; posting-host="33dab6b85b955ed0102028bfe3f606d5"; logging-data="1906337"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19fkZwanB+yM/f6cteDh1YC" User-Agent: XanaNews/1.18.1.6 Cancel-Lock: sha1:r0xmnBzGZejPqVIDE41DGgDRPHg= Bytes: 1137 Barry Margolin wrote: > > (mapcan #'(lambda (x) (and (numberp x) (list x))) list) > > > (loop for x in list > > when (numberp x) collect x) > > I agree with this example. Once I learned LOOP I never used the > above idiom again. (filter number? '(a b c 1 2 3)) ===> (1 2 3)