Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!usc!jarthur!bgribble From: bgribble@jarthur.Claremont.EDU (Bill Gribble) Newsgroups: comp.sys.handhelds Subject: Re: Using CLEAR in progs (Was: Re: new puzzle, new blinky) Keywords: 48sx, CLEAR, programs Message-ID: <10483@jarthur.Claremont.EDU> Date: 25 Jan 91 21:08:56 GMT References: <1991Jan10.172803.2262@DRD.Com> <56027@eerie.acsu.Buffalo.EDU> <27a06d1f:1696.3comp.sys.handhelds;1@hpcvbbs.UUCP> Organization: Harvey Mudd College, Claremont, CA 91711 Lines: 27 In article <27a06d1f:1696.3comp.sys.handhelds;1@hpcvbbs.UUCP> akcs.falco@hpcvbbs.UUCP (Andrey Dolgachev) writes: >I also agree with the opinion that a program shouldn't clear the stack. >Considereing that it take virtually no effort to save the stack, it seems >senseless not to. A simple way to save the state of the calculator is to >simply store the flags, put the contents of the stack into a list, save >the list and flags as local vars, execute your program with all the >clears, flag changings, etc. you want, and then simply recall the flags >and the stack. I agree with all the people who are saying that you shouldn't screw with the stack unless you are taking arguments; however, I don't like this idea too much. Seems like the 'real' answer would be to exercise a little programming discipline and just never clear the stack. I would think Style Rule #1 for HP programmers is to debug your programs well enough that you don't ever have to use CLEAR. What if you have some huge hunker programs and strings and graphics and .. on the stack and you don't have enough memory to save the stack to run some trivial program? Just my $.02. > ---Falco ***************************************************************************** ** Bill Gribble Harvey Mudd College, Claremont, CA ** ** bgribble@jarthur.claremont.edu Never heard of it? You're stupid. ** *****************************************************************************