Content deleted Content added
→Pike: copy editing, etc. |
→PostScript: copy editing |
||
Line 1,420:
</syntaxhighlight>
===
In [[PostScript]], associative arrays are called dictionaries. In Level 1 PostScript they must be created explicitly, but Level 2 introduced direct declaration using
<syntaxhighlight lang="postscript">
Line 1,440:
% Both methods leave the dictionary on the operand stack
</syntaxhighlight>
Dictionaries can be accessed directly, using
<syntaxhighlight lang="postscript">
Line 1,451 ⟶ 1,452:
</syntaxhighlight>
Dictionary contents can be iterated through using
<syntaxhighlight lang="postscript">
Line 1,461 ⟶ 1,462:
>> {exch =print ( is ) print ==} forall
</syntaxhighlight>
<syntaxhighlight lang="postscript">
That is 2
Line 1,468 ⟶ 1,471:
</syntaxhighlight>
Dictionaries can be augmented (up to their defined size only in Level 1) or altered using
<syntaxhighlight lang="postscript">
% define a dictionary for easy reuse:
|