Re: Local variables in RPN programmable? Message #12 Posted by Howard Owen on 28 Oct 2011, 11:22 a.m., in response to message #3 by Egan Ford
New stack semantics would be one way to implement locals, but there's another approach that would be consistent with classic RPN semantics. Like all programmable HP calculators, the 34S has addressable registers. Why not dynamically allocate space for a local register in a subroutine whenever the user uses a particular naming style. So register -10, for example, would be local to the current scope and all child scopes, if not overridden, and would go away when out of scope.
edit: I imagine this might be impossible to implement on the WP-34S, with its already full memory, This suggestion would be applicable to a follow-on machine with more resources.
Edited: 28 Oct 2011, 11:36 a.m. after one or more responses were posted
|