|Re: rpn stack drop|
Message #29 Posted by James M. Prange (Michigan) on 18 June 2007, 6:14 p.m.,
in response to message #16 by K. Stefan Jansson (IL, USA)
Actually, Bill Wickes wrote a book named HP 41/HP 48 Transitions. A scanned .PDF copy of it is available on the current HP Museum CD-ROM set / DVD-ROM.
Although I certainly have a great deal of respect for Bill Wickes, I'm surprised at that statement from him. I suppose that "starting with a clean slate" might be a reason for some to use the CLX key, but I'd be surprised if that were a common practice for most Classic RPN users. Certainly this "use" of CLX had never occurred to me. After all, pressing CLX as the start of a new problem simply means that a zero in register X will be replaced (without changing anything else) instead of whatever already happens to be in register X being replaced (discarding the contents of T and lifting the contents of the previous X, Y, and Z to Y, Z, and T). Certainly if the user cares about the contents of Y, Z, or T, then he's going to take care of that. Why waste the extra CLX keystroke?
If one really wants to "start with a clean slate", then CLST (on a 41) would seem to me a more reasonable choice, as it loads zeros into all stack registers, possibly saving the user the trouble of pushing zeros into all of them. Of course, depending on the model and what the user intends to do next, there may be other areas (such as statistics data) that the user may want to clear for a "clean slate".
Using CLX seems to me analogous to using the CE key instead of the C key on on an algebraic entry model. Certainly using CE doesn't prevent such "features" as "constants operations" on an algebraic model; if you want the "clean slate", then you use the C key.
It seems to me that a much more reasonable primary reason for using CLX would be for when the user realized that he's entered the wrong value, and wants to replace it with the correct value without disturbing anything else, much like using a CE key on an algebraic input model.
Bill Wickes also mentions CLX in various other places in Transitions; notably, "CLX is primarily intended for replacing the contents of X with a new value. By disabling stack lift, the zero CLX enters can be overwritten by a following entry."
On an RPL model, a CLX key would seem rather silly. First off, a stack level can point to any type of object, so replacing the contents of level 1 with the real number zero wouldn't be such an obvious choice. More importantly, on an RPL model, one never writes directly into level 1, so to replace a "zeroed-out" level one, one would have to edit the level 1 object in the command line editor and enter the edited contents. It's easier to simply remove level 1 with a DROP, key in a new value (which automatically activates the command line editor), and enter the new value. Of course, if one wants to abandon the command line editor (discarding any contents), then the CANCEL (or ATTN) key is pressed.
Edited: 19 June 2007, 3:09 a.m.