🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #869

Re: Interesting Bug

#869
From: Ned Batchelder
Date: Tue, 15 Aug 1989 19:25
16 lines
1077 bytes
PostScript will recognize that it is in an infinite recursion. This is
one case where it won't, though, because they've implemented tail
recursion. In other words, if the last thing a procedure does is call
another procedure, instead of pushing the new procedure on the execution
stack, the interpreter simply replaces the old procedure with the new
procedure. This saves an entry on the execution stack, and also a little
bit of time modifying pointer, checking bounds, etc.

If your procedure had been

	/L { L 1 pop } def

then you would have quickly received an execstackoverflow error.


Ned Batchelder, Digital Equipment Corp., BatchelderN@Hannah.DEC.com
Technical Details
Message-ID: <4079@shlump.nac.dec.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!cica!iuvax!purdue!haven!decuac!shlump.nac.dec.com!level.dec.com!batcheldern
References: <1365@intercon.UUCP> <2106@optilink.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!cica!iuvax!purdue!haven!decuac!shlump.nac.dec.com!level.dec.com!batcheldern
From: batcheldern@level.dec.com (Ned Batchelder)
Newsgroups: comp.lang.postscript
Subject: Re: Interesting Bug
Message-ID: <4079@shlump.nac.dec.com>
Date: 15 Aug 89 19:25:43 GMT
References: <1365@intercon.UUCP> <2106@optilink.UUCP>
Organization: DEC
Lines: 16