3 ms·
I like to repeat everywhere that HP48 series had code block syntax with arrow notation. << a -> a a + >> (double function) Those machines were well before
by agumonkey 6y ago
I like to repeat everywhere that HP48 series had code block syntax with arrow notation.
<< a -> a a + >> (double function)
Those machines were well before their time.. I hope the makers had fun, it's really sad it's gone from the market although one could say that ES6 in your smartphone browser is your modern day HP48 reincarnation.
- mssundaram 6y agoMy grandfather was a civil engineer and he had a number of different RPN HP calculators. He gave them to me when I was becoming interested in programming - a really exciting gift to explore.
- madengr 6y agoDo you still have them? Back in the 90’s when HP was discontinuing them, I bought 4x 32sii. I still have them un-opened. I still have my dads LED one from the 70’s. They are collectors items now.
- ghaff 6y agoAnd the LED ones had relatively short battery life; they were rechargeable. When I started college, HP calculators were still very expensive so I started with a TI. Within a year or two, you could get an HP LED model (HP-55 in my case) for a reasonable price. Through college I still took a slide rule to exams as a backup in case the battery died for some reason though I never had to use it. During the latter part of the 70s, calculators were dropping in price extremely rapidly.
- MaxBarraclough 6y agoHere's my take on the Forth equivalent. Defining a DOUBLE word, the usual way, rather than anonymously. (Tricky to pick a good identifier that doesn't sound like it's doing something with double-precision floats.) ( num -- num_doubled ) : DOUBLE DUP + ; Next up, we push 7 to the stack, define our 'function' (not a Forth term) anonymously using :NONAME which pushes an execution token value to the stack, then we immediately invoke it. This has the effect of printing 14. 7 :NONAME DUP + ; EXECUTE .
- MaxBarraclough 6y agoToo late to edit: the second example leaks memory, as the execution token is not destroyed before becoming inaccessible. As far as I know, ANS Forth doesn't offer a friendly interface for destroying execution tokens.