Post Reply 
(Free42) GTOs - question
04-11-2018, 01:00 PM
Post: #9
RE: (Free42) GTOs - question
(03-27-2018 05:36 AM)Werner Wrote:  and now, a request for incompatibilty ;-)

The 42S has 8 return stack levels, faithfully reproduced in Free42 - but why? This is a case where the 42S is not 'compatible' with the 41 either - I know of no programming construct where you'd purposefully exploit having only 8 return levels.
In view of the vastly larger programming space, wouldn't it make sense to remove that limit altogether?

The fact that the HP-42S isn't perfectly compatible with the HP-41C is no excuse for Free42 not to be as close as possible to perfectly compatible with the HP-42S. Big Grin

Still, I have been chewing on this for a while, and I agree that removing the eight-level limit from the return stack seems highly unlikely to cause any existing programs to fail -- and if or when such programs do turn up, adding an option to restore the limit would always be a possibility.

It made me think, though: the more deeply you can nest subroutines, the more annoying the lack of local variables becomes. Looking for a way to address this, without RPLifying Free42, I came up with this idea: a new function called LVAR, which takes an alpha argument, no indirect allowed (i.e. syntactically like MVAR), which stores the contents of X in a new local variable, which exists until execution returns from the current level. The local variables will have dynamic scope, and will hide any global variables with the same name.

I haven't decided to do this yet, but I think it's an interesting idea, assuming I can figure out how to deal with the potential problems, e.g. should local variables show up in variable catalogs, how would they interact with REGS, SOLVE, and INTEG, and who knows what else may turn up.

Thoughts?
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(Free42) GTOs - question - Werner - 03-26-2018, 08:53 AM
RE: (Free42) GTOs - question - Paul Dale - 03-26-2018, 11:05 AM
RE: (Free42) GTOs - question - Werner - 03-26-2018, 11:22 AM
RE: (Free42) GTOs - question - Paul Dale - 03-26-2018, 11:49 AM
RE: (Free42) GTOs - question - Werner - 03-26-2018, 01:14 PM
RE: (Free42) GTOs - question - Werner - 03-26-2018, 01:15 PM
RE: (Free42) GTOs - question - Werner - 03-27-2018, 05:36 AM
RE: (Free42) GTOs - question - Thomas Okken - 04-11-2018 01:00 PM
RE: (Free42) GTOs - question - Werner - 04-11-2018, 02:04 PM
RE: (Free42) GTOs - question - Werner - 04-12-2018, 05:33 AM
RE: (Free42) GTOs - question - Paul Dale - 04-11-2018, 11:51 PM



User(s) browsing this thread: 1 Guest(s)