SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /func {
  2. /var1 exch def
  3. /var2 exch def
  4. ... process ...
  5. } def
  6.  
  7. (var2)(var1)func
  8.    
  9. (Stack is no empty) {/var2 exch def}{/var2 (default) def} ifelse
  10.    
  11. /rotate { % angle [matrix]  rotate  -
  12.     dup type /arraytype ne
  13.     { true exch matrix } % no array: create array, concat later
  14.     { false 3 1 roll } % array: do not create, do not concat later
  15.     ifelse % bool angle matrix
  16.     dup 0 2 index cos put % bool angle matrix
  17.     dup 1 2 index sin put % bool angle matrix
  18.     dup 2 2 index sin neg put % bool angle matrix
  19.     dup 3 4 3 roll cos put % bool matrix
  20.     exch { concat } if % [matrix]
  21. } def
  22.    
  23. /func { %<<params>>
  24. %begin currentdict /var2 2 copy known not {(default) put}{pop pop} ifelse
  25. <</var2(default)>> copy begin
  26. % ... process ...
  27. end } def
  28.  
  29. <<
  30. /var1 (var1)
  31. /var2 (var2)
  32. >> func
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top