Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #115: your keyboard's space bar is generating spurious keycodes.


comp / comp.lang.lisp / Re: How can "cons per call" be so different for these two

SubjectAuthor
o Re: How can "cons per call" be so different for these twoB. Pym

1
Subject: Re: How can "cons per call" be so different for these two
From: B. Pym
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Mon, 26 Aug 2024 03:22 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Nobody447095@here-nor-there.org (B. Pym)
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=
View all headers

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))

1

rocksolid light 0.9.8
clearnet tor