| Deutsch English Français Italiano |
|
<1036965$12i2g$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: need help with data structure problem
Date: Sat, 21 Jun 2025 12:39:34 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <1036965$12i2g$1@dont-email.me>
References: <1034rga$akhr$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Injection-Date: Sat, 21 Jun 2025 14:39:35 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a5db6e9518afbdcadaf8d126abf21672";
logging-data="1132624"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Mbcr26blN6zFUGs1GgXqN"
User-Agent: XanaNews/1.18.1.6
Cancel-Lock: sha1:LCVOLK5gCo+4J36RG3hLiMLYlxk=
B. Pym wrote:
> Kenny Tilton wrote:
> > (defun join-similar (pairs &aux result)
> > (dolist (pair pairs (nreverse result))
> > (nconc (or (assoc (first pair) result)
> > (first (push (list (first pair)) result)))
> > (list (second pair)))))
He didn't notice that
(list (second pair)))))
ought to have been
(cdr pair))))
His solution and my last one seem to indicate that
non-functional (mutating) programming can result in
concise code.