aboutsummaryrefslogtreecommitdiff
path: root/postscript/prologues/unbind.ps
blob: 98e6283e69b423ed79dd10a566dd669d0ee48142 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
%
% Unbind the operators in an executable array or packedarray. Leaves the
% unbound array or the original object on the stack.
%

/unbind {
	0 index xcheck
	1 index type /arraytype eq
	2 index type /packedarraytype eq or and {
		dup length array copy cvx
		dup 0 exch {
			dup type /operatortype eq {
				(                          ) cvs cvn cvx
			} if

			0 index xcheck
			1 index type /arraytype eq
			2 index type /packedarraytype eq or and {
				unbind
			} if

			3 copy put pop
			1 add
		} forall
		pop
	} if
} def