unbind.ps 526 B

12345678910111213141516171819202122232425262728
  1. %
  2. % Unbind the operators in an executable array or packedarray. Leaves the
  3. % unbound array or the original object on the stack.
  4. %
  5. /unbind {
  6. 0 index xcheck
  7. 1 index type /arraytype eq
  8. 2 index type /packedarraytype eq or and {
  9. dup length array copy cvx
  10. dup 0 exch {
  11. dup type /operatortype eq {
  12. ( ) cvs cvn cvx
  13. } if
  14. 0 index xcheck
  15. 1 index type /arraytype eq
  16. 2 index type /packedarraytype eq or and {
  17. unbind
  18. } if
  19. 3 copy put pop
  20. 1 add
  21. } forall
  22. pop
  23. } if
  24. } def