Deutsch English Français Italiano |
<vagsdl$2aciq$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "B. Pym" <Nobody447095@here-nor-there.org> Newsgroups: comp.lang.lisp Subject: Re: How can "cons per call" be so different for these two Date: Mon, 26 Aug 2024 03:22:30 -0000 (UTC) Organization: A noiseless patient Spider Lines: 22 Message-ID: <vagsdl$2aciq$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Injection-Date: Mon, 26 Aug 2024 05:22:30 +0200 (CEST) Injection-Info: dont-email.me; posting-host="ddb29dda6a5be89b0e6e9e24964aa013"; logging-data="2437722"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+PcvFIg5lH3zZBQcjIgykp" User-Agent: XanaNews/1.18.1.6 Cancel-Lock: sha1:uM/aO1uJuYGxlY7AnZFXjRS4+CE= Bytes: 1604 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))