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.

261 globalize<br />

single store variable and thus a single value to be returned.) The value<br />

returned by the accessing form is, of course, affected by execution of the<br />

storing form, but either of these forms may be evaluated any number of<br />

times, and therefore should be free of side effects (other than the storing<br />

action of the storing form).<br />

The temporary variables and the store variables are generated names, as if<br />

by gensym or gentemp, so that there is never any problem of name<br />

clashes among them, or between them and other variables in the program.<br />

This is necessary to make the special forms that do more than one setf in<br />

parallel work properly. These are psetf, shiftf and rotatef.<br />

Here are some examples of setf methods for particular forms:<br />

• For a variable x:<br />

o<br />

o<br />

(g8881)<br />

(setq x g88(1)<br />

x<br />

• For (car exp):<br />

(g8882)<br />

(exp)<br />

(g8883)<br />

(progn (rplaca g8882 g88(3) g88(3)<br />

(car g88(2)<br />

• For (supseq seq s e):<br />

(g8884 g8885 g88(6)<br />

(seq s e)<br />

(g8887)<br />

(progn (replace g8884 g8887 :start1 g8885 :end1 g88(6)<br />

g88(7)<br />

(subseq g8884 g8885 g88(6)<br />

globalize name &optional package Function<br />

Establish a symbol named name in package and export it. If this causes<br />

any name conflicts with symbols with the same name in packages that use<br />

package, instead of signalling an error make an attempt to resolve the<br />

name conflict automatically. Print an explanation of what is being done on<br />

<strong>zl</strong>:error-output.<br />

globalize is useful for patching up an existing package structure. For example,<br />

if a new function is added to the Lisp language globalize can be<br />

used to add its name to the global package and hence make it accessible to<br />

I

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

Saved successfully!

Ooh no, something went wrong!