Article View: comp.lang.misc
Article #2323Re: A challenge to the anti-goto
From: Stephen J Bevan
Date: Wed, 04 Nov 1992 20:43
Date: Wed, 04 Nov 1992 20:43
20 lines
1701 bytes
1701 bytes
In article <Bx6z1J.57r@mentor.cc.purdue.edu> hrubin@pop.stat.purdue.edu (Herman Rubin) writes: [ you could use continuations ] There are two major problems with this. For one, the stack grows with the non-returns, and taking care of this would be at least as bad as garbage collection, if not worse, as stack locations are, for extremely good reasons, not globally known. For another, this does not handle procedures which continue the resource use of the current procedure. If the whole thing is written using continuations, then the stack does not have to grow at all as each function has no "return" it only has a "goto next" call at the end. As for using values in the current "procedure", pass them as parameters, the compiler _should_ notice that they are being used in a routine that is being "goto'd to" and so not actually push them on the stack or otherwise shuffle them about. If I had a (cooperative) Scheme compiler online I'd try this out to see what sort of code it produces, but I don't, so I can't :-< bevan
Technical Details
Message-ID:
<BEVAN.92Nov4204333@hippo.cs.man.ac.uk>Path:
arc1-ca.pugleaf.net!sparky!uunet!olivea!spool.mu.edu!agate!doc.ic.ac.uk!uknet!mucs!m1!bevanReferences:
<PSM.92Nov3165530@soma.sics.se> <1992Nov3.165005.18037@midway.uchicago.edu> <BEVAN.92Nov3211454@hippo.cs.man.ac.uk> <Bx6z1J.57r@mentor.cc.purdue.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!spool.mu.edu!agate!doc.ic.ac.uk!uknet!mucs!m1!bevan From: bevan@cs.man.ac.uk (Stephen J Bevan) Newsgroups: comp.lang.misc Subject: Re: A challenge to the anti-goto Message-ID: <BEVAN.92Nov4204333@hippo.cs.man.ac.uk> Date: 4 Nov 92 20:43:33 GMT References: <PSM.92Nov3165530@soma.sics.se> <1992Nov3.165005.18037@midway.uchicago.edu> <BEVAN.92Nov3211454@hippo.cs.man.ac.uk> <Bx6z1J.57r@mentor.cc.purdue.edu> Sender: news@cs.man.ac.uk Organization: Department of Computer Science, University of Manchester Lines: 20 In-reply-to: hrubin@pop.stat.purdue.edu's message of 4 Nov 92 12:36:55 GMT