17.05.2015 Views

zl:1 - FTP

zl:1 - FTP

zl:1 - FTP

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

363 nintersection<br />

(loop-never '(b c a e) => (8 C A E)<br />

(loop-never '(a a»<br />

=> A NIL<br />

See the section "loop Clauses", page 310.<br />

nintersection listl list2 &key (test #'eqI) test-not (key #'identity) Function<br />

nintersection is the destructive version of intersection. intersection takes<br />

listl and list2 and returns a new list containing everything that is an element<br />

of both lists. nintersection performs the same operation, but uses<br />

the cells of listl to construct the result. The value of list2 is not altered.<br />

The keywords are:<br />

:test<br />

:test-not<br />

:key<br />

Any predicate specifying a binary operation to be applied<br />

to a supplied argument and an element of a target list.<br />

The item matches the specification only if the predicate<br />

returns t. If :test is not supplied the default operation is<br />

eql.<br />

Similar to :test, except the item matches the specification<br />

only if there is an element of the list for which the<br />

predicate returns nil.<br />

If not nil, should be a function of one argument that will<br />

extract from an element the part to be tested in place of<br />

the whole element.<br />

See the function intersection, page 277. For example:<br />

(setq a-list '(a be» => (A 8 C)<br />

I<br />

(setq b-list '(f a d» => (F A 0)<br />

(nintersection a-list b-list) => (A)<br />

a-list => (A)<br />

b-list => (F A 0)<br />

For a table of related items: See the section "Functions for Comparing<br />

Lists" in Symbolics Common Lisp: Language Concepts.<br />

<strong>zl</strong>:nintersection &rest lists Function<br />

Takes any number of lists that represent sets and returns a new list that<br />

represents the intersection of all the sets it is given, by destroying any of<br />

the lists passed as arguments and reusing the conses. <strong>zl</strong>:nintersection<br />

uses eq for its comparisons. You cannot change the function used for the<br />

comparison. (<strong>zl</strong>:nintersection) returns nil.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!