17.05.2015 Views

zl:1 - FTP

zl:1 - FTP

zl:1 - FTP

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

587<br />

tailp<br />

(let ((x 'hello»<br />

(tagbody<br />

(catch 'stuff<br />

(if (numberp x)<br />

(princ Na number")<br />

(go trouble»)<br />

(return)<br />

trouble<br />

(princ "trouble trouble") (terpri») => trouble trouble<br />

NIL<br />

The following two forms are equivalent:<br />

(dotimes (i n) (print i»<br />

(let ((i 8»<br />

(when (plusp n)<br />

(tagbody<br />

loop<br />

(print i)<br />

(setq i (1+ i»<br />

(when « i n) (go loop»»)<br />

For a table of related items: See the section "Transfer of Control<br />

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

tailp sublist list Function<br />

tailp returns t if sublist is an ending sublist of list (that is, a subset of the<br />

conses that make up list) and otherwise returns nil. Another way to look at<br />

this is that tailp returns t if (nthcdr n list) returns sub list for all n. For<br />

example:<br />

(setq item-list '(a b c» => (A B C)<br />

(tailp (cdr item-list) item-list) => T<br />

(tailp (car item-list) item-list) => NIL<br />

(tailp (nthcdr 2 item-list) item-list) => T<br />

I<br />

(tailp nil item-list) => T<br />

tailp could have been defmed by:

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

Saved successfully!

Ooh no, something went wrong!