| Deutsch English Français Italiano |
|
<103b4m0$159p4$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: "B. Pym" <Nobody447095@here-nor-there.org> Newsgroups: comp.lang.lisp Subject: Re: which articles are sold? Date: Mon, 23 Jun 2025 08:53:21 -0000 (UTC) Organization: A noiseless patient Spider Lines: 25 Message-ID: <103b4m0$159p4$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Injection-Date: Mon, 23 Jun 2025 10:53:21 +0200 (CEST) Injection-Info: dont-email.me; posting-host="99ca4bfa6fc4ff5666efb961c45610da"; logging-data="1222436"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/B7OjGDZ7TIVWevz5OrH5U" User-Agent: XanaNews/1.18.1.6 Cancel-Lock: sha1:qjbqbQTqL0peCiYtn/+7b3Qjtsw= Lieven Marchand wrote: > > if we have this list: > > (a <sold> b c d <sold> e f g <sold>) > > that shows that article a, d and g are sold and the rest are not how > > can we put all the sold articles in one list: > > (a d g) > > More homework? > > (loop for (first next) on '(a <sold> b c d <sold> e f g <sold>) > when (eql next '<sold>) > collect first) Scheme: (define items '(a <sold> b c d <sold> e f g <sold> h i <sold>)) (filter-map (lambda(x y) (and (eq? '<sold> y) x)) items (cdr items)) ===> (a d g i)