09.12.2012 Views

Preface - Adobe

Preface - Adobe

Preface - Adobe

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

CHAPTER 3<br />

Arrays<br />

32<br />

Language<br />

The characters [ and ] are self-delimiting tokens that specify the construction of<br />

an array. For example, the program fragment<br />

[ 123 /abc (xyz) ]<br />

results in the construction of an array object containing the integer object 123,<br />

the literal name object abc, and the string object xyz. Each token within the<br />

brackets is executed in turn.<br />

The [ and ] characters are special syntax for names that, when executed, invoke<br />

PostScript operators that collect objects and construct an array containing them.<br />

Thus the example<br />

[ 123 /abc (xyz) ]<br />

contains these five tokens:<br />

• The name object [<br />

• The integer object 123<br />

• The literal name object abc<br />

• The string object xyz<br />

• The name object ]<br />

When the example is executed, a sixth object (the array) results from executing<br />

the [ and ] name objects.<br />

Procedures<br />

The special characters { and } delimit an executable array, otherwise known as a<br />

procedure. The syntax is superficially similar to that for the array construction operators<br />

[ and ]; however, the semantics are entirely different and arise as a result of<br />

scanning the procedure rather than executing it.<br />

Scanning the program fragment<br />

{add 2 div}

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

Saved successfully!

Ooh no, something went wrong!