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.

delete-if-not 170<br />

If the value of the :from-end argument is non-nil, it only affects the result<br />

when the :count argument is specified. In that case only the rightmost<br />

:count elements that satisfy the predicate are deleted.<br />

For example:<br />

(delete-if #'numberp '(4 2 4 1) :count 1 ) => (2 4 1)<br />

(delete-if #'numberp '(4 2 4 1) :count 1 :from-end t) => (4 2 4)<br />

Use the keyword arguments :start and :end to delimit the portion of the<br />

sequence to be operated on.<br />

:start and :end must be non-negative integer indices into the sequence.<br />

:start must be less than or equal to :end, else an error is signalled. It<br />

defaults to zero (the start of the sequence).<br />

:start indicates the start position for the operation within the sequence.<br />

:end indicates the position of the first element in the sequence beyond the<br />

end of the operation. It defaults to nil (the length of the sequence).<br />

If both :start and :end are omitted, the entire sequence is processed by<br />

default.<br />

For example:<br />

(delete-if #'atom 'e'a 1 "list")) => ('A)<br />

I<br />

(delete-if #'numberp '(4 1 4) :start 1 :end 2) => (4 4)<br />

(delete-if #'evenp '(4 1 4) :start 0 :end 3) => (1)<br />

The :count argument, if supplied, limits the number of elements deleted.<br />

If more than :count elements of sequence satisfy the predicate, then only<br />

the leftmost :count of those elements are deleted.<br />

For example:<br />

(del ete-i f #' oddp I (1 1 2 2) : count 1 ) => (1 2 2)<br />

delete-if is the destructive version of remove-if.<br />

For a table of related items: See the section "Sequence Modification" in<br />

Symbolics Common Lisp: Language Concepts.<br />

delete-if-not predicate sequence &key key from-end (start 0) end Function<br />

count<br />

delete-if-not returns a sequence of those items in the subsequence of sequence<br />

delimited by :start and :end which do not satisfy predicate. The<br />

elements that are not deleted occur in the same order in the result that<br />

they did in the argument. This is a destructive operation. The argument

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

Saved successfully!

Ooh no, something went wrong!