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.

<strong>zl</strong> :return-list<br />

456<br />

I<br />

Examples:<br />

Or<br />

(do «x x (cdr x»<br />

(n 8 (* n 2»)<br />

«null x) n)<br />

(cond «atom (car x»<br />

(setq n (1+ n»)<br />

«memq (caar x) '(sys boom bleah»<br />

(return-from nil n»»<br />

(Block nil<br />

(print "rivers hills")<br />

(if (= 3 3.) (return-from nil "five"»<br />

(print "water trees"» => "rivers hills" "five"<br />

Following is another example, returning multiple values. The function<br />

below is like assoc, but it returns an additional value, the index in the<br />

table of the entry it found:<br />

(de fun assocn (x table)<br />

(do «1 table (cdr 1»<br />

(n e (1+ n»)<br />

«null 1) nil)<br />

(if (eql (caar 1) x)<br />

(return-from nil (values (car 1) n»»)<br />

For a table of related items: See the section "Blocks and Exits Functions<br />

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

<strong>zl</strong>:return-list form Special Form<br />

An obsolete function supported for compatibility with earlier releases. It is<br />

like return except that the block returns all of the elements of list as multiple<br />

values. This means that the following two forms are equivalent:<br />

Examples:<br />

(<strong>zl</strong>:return-list list)<br />

(return (values-list list»

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

Saved successfully!

Ooh no, something went wrong!