5 karma · joined Aug 6, 2019 (7y ago) · 5 submissions
comment 7y ago · link · parent
I have a stopwatch function in my HP48 that I don't want using a local variable (avoid polluting my precious menu), or having to keep it in a stack.
Instead I want the value of the last time I ran the program to be stored within the program itself. I believe this is called a closure in CS.
Right now I can have << value -> X 'expression' EVAL rest of the program >>
And it'll work just fine, but how could I get the value at the very top modified?
(I know my cell phone has a stopwatch. We're not allowed phones at work)
comment 7y ago · link · parent
Scheme allows multiple arguments, RPL cannot. I.e.
(+ 1 2 3 ) evals to 6,
1 2 3 + evals to 1 5
RPL cant add your entire stack because presumably you have stuff in your stack you want to keep and not add.
But, if we put that aside, if RPL allowed:
[ 1, 4, 5, 6, [4 ,2 1, 6]]
where [] represent stacks, i.e. a stack can be an object in the stack, then the RPL would be very close to lisp.
Which is very close to what this min does.