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.

push 416<br />

I<br />

push item reference &key area localize Function<br />

If the list held in reference is viewed as a push-down stack, then push<br />

pushes an element onto the top of the stack. The value of the argument<br />

item can be any lisp object. The value of the argument reference can be<br />

the name of any generalized variable containing a list. item is consed onto<br />

the front of the list, and the augmented list is stored back into reference<br />

and returned. The value of reference can be any form acceptable as a<br />

generalized variable to setf.<br />

The effect of (push item place) is the same as (setf place (cons item place),<br />

except that the setf form evaluates any subforms of place twice, while push<br />

evaluates them only once. Moreover, for certain place forms, push can be<br />

significantly more efficient than the setf form.<br />

The optional keyword arguments :area and :localize are Symbolics extensions<br />

to Common Lisp.<br />

:area<br />

:localize<br />

Examples:<br />

An integer that specifies the area in which to store the<br />

augmented list. See the section "Areas" in Internals,<br />

Processes, and Storage Management.<br />

Can be nil, t, or a positive integer, which behave as follows:<br />

nil<br />

t<br />

integer<br />

Do not change the behavior of push.<br />

Localize the top level of list structure<br />

by calling sys:localize-list or<br />

sys:localize-tree on the list before<br />

returning it.<br />

Localize integer levels of list structure<br />

by calling sys:localize-list or<br />

sys:localize-tree on the list before<br />

returning it.<br />

(setq alist '«a. b) (c . d))) => «A. 8) (C . D))<br />

(push '(1.2) (cdr alist)) => «1.2) (C . D))<br />

alist => «A. 8) (1 . 2) (C . D))<br />

(push '(3 . 4) alist :localize 2) =><br />

( (3 . 4) (A . ",8) (1 . 2) (C . D))<br />

alist => «3 . 4) (A . 8) (1<br />

. 2) (C . D))<br />

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

Lists and Conses" in Symbolics Common Lisp: Language Concepts.

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

Saved successfully!

Ooh no, something went wrong!