Is RPN still relevant?
|
12-20-2023, 10:26 PM
Post: #55
|
|||
|
|||
RE: Is RPN still relevant?
(12-18-2023 03:18 PM)bxparks Wrote:(12-18-2023 12:08 PM)ijabbott Wrote: Indeed, a four-level stack is an artifice that has no place in teaching or learning mathematics. The NSTK mode opens other avenues, such as thinking about how computers work internally. Same here. I have no need for a four-line display to show what's in the stack registers. If you can't keep track of them, a display might not be of much use anyway, because it'll show you numbers but not tell you what each number is. Quote:Beyond 4 levels, [...] it makes programming in a stack-based language like Forth frustrating. (RPL seems very similar to Forth as far as I can tell.) The following is slightly edited from a stacks article on my website.
Subroutines automatically leave other subroutines' "scratchpad space" on the stack undisturbed. In fact, in recursion, a routine calls itself, even multiple nested levels deep, which a stack allows it to do. (As you might expect, it is important to make sure that the condition to back out of the recursion is met before you overrun the available stack space.) Comments should prevent the possibility of confusion of what's on the stack. Sure, I've seen very unreadable source code in Forth, but I blame that on the programmer, not the language. I've seen horrid source code in the other languages I've worked with, too. http://WilsonMinesCo.com (Lots of HP-41 links at the bottom of the links page, http://wilsonminesco.com/links.html ) |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)