Article View: comp.lang.postscript
Article #6619Re: How do I make a really big procedure?
From: David Bau
Date: Sat, 09 Jan 1993 02:12
Date: Sat, 09 Jan 1993 02:12
31 lines
1333 bytes
1333 bytes
koreth@spud.Hyperion.COM (Steven Grimm) writes:
>Unfortunately, on one of the printers I'm using, I get a stack overflow
>when I try to define this procedure (which can end up being fairly large
>if the image is complex). This happens whether I call the procedure or
>not.
Instead of expanding the stack, might it be possible to break up the
procedure in to subprocedures? This can be done quite mechanically;
you don't even have to assign procedure names.
Instead of writing:
/proc {2 3 4 add mul} bind def
you can write
/procarray [{2 3}{4 add}{mul}] def
/proc {procarray {exec} forall} bind def
or you can go even further (and get the bind to do all the work once)
/procarray [[{2 3}{4 add}{mul}] {bind} forall] def
/proc {procarray {exec} forall} bind def
This strategy is not capable of breaking up code within {} blocks
without modification.
Anybody have any better ideas?
David Bau
Technical Details
Message-ID:
<1993Jan9.021252.12354@cs.cornell.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!gatech!rpi!batcomputer!cornell!bauReferences:
<1il4huINNaiu@spud.Hyperion.COM>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.postscript Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!rpi!batcomputer!cornell!bau From: bau@cs.cornell.edu (David Bau) Subject: Re: How do I make a really big procedure? Message-ID: <1993Jan9.021252.12354@cs.cornell.edu> Organization: Cornell Univ. CS Dept, Ithaca NY 14853 References: <1il4huINNaiu@spud.Hyperion.COM> Date: Sat, 9 Jan 1993 02:12:52 GMT Lines: 31