Skip to main content
Participant
August 15, 2008
Question

Get procedure content from it's name

  • August 15, 2008
  • 2 replies
  • 593 views
In PostScript, if I only know a procedure's name, can I find out the content of that procedure?

For example, if there is a procedure defined by

/abc {1 2 add} def

somewhere before, how can I get a output like

{1 2 add}

from the precedure's name "abc"?

I have tried "cvs" operator, but that only output the procedure name "abc".
This topic has been closed for replies.

2 replies

_zetab_Author
Participant
August 15, 2008
But which operator can iterate through procedure?
The "forall" operator can only iterate array, dictionary and string.
Participating Frequently
August 15, 2008
A procedure is an array.

Aandi Inston
Participating Frequently
August 15, 2008
You can iterate through the elements of the procedure, and convert
each one to a string. You will have to decide what to do if you find a
nested procedure. Be warned that in rare cases a procedure could be
nested in itself.

Aandi Inston