Sujet : Re: need help with data structure problem
De : Nobody447095 (at) *nospam* here-nor-there.org (B. Pym)
Groupes : comp.lang.lispDate : 21. Jun 2025, 13:39:34
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <1036965$12i2g$1@dont-email.me>
References : 1
User-Agent : XanaNews/1.18.1.6
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.