Sujet : Re: How can "cons per call" be so different for these two
De : Nobody447095 (at) *nospam* here-nor-there.org (B. Pym)
Groupes : comp.lang.lispDate : 26. Aug 2024, 05:22:30
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vagsdl$2aciq$1@dont-email.me>
User-Agent : XanaNews/1.18.1.6
Thomas A. Russ wrote:
Well if you alway use these two functions together, it would be more
efficient to generate both the results at once:
...
The case could be made either way for this one, though, and certainly
it would be better in terms of efficiency; thanks again for the
suggestion.
...
(defun split-on-corpus (atoms preprocessed-corpus)
(loop :for atom :in atoms
:if (gethash atom preprocessed-corpus)
:collect atom :into present
:else :collect atom :into absent
:finally (return (list present absent))))
Gauche Scheme:
(define (split-on-corpus atoms corpus)
(partition
(pa$ hash-table-exists? corpus)
atoms))