cm0002@suppo.fi to Programmer Humor@programming.dev · 1 month agoForthsuppo.fiimagemessage-square14linkfedilinkarrow-up1142arrow-down15file-text
arrow-up1137arrow-down1imageForthsuppo.ficm0002@suppo.fi to Programmer Humor@programming.dev · 1 month agomessage-square14linkfedilinkfile-text
minus-squaredavidgro@lemmy.worldlinkfedilinkarrow-up5·1 month agoThisgreatisone! ? If the operands go the other way, I suppose: oneisgreatThis!
minus-squareotacon239@lemmy.worldlinkfedilinkarrow-up4·1 month agoThe stack doesn’t quite work like that. They would get added like this: This > buffer great, is, one > stack Then, each + pulls the latest off the stack and operates. First + would pull ‘one’ as it’s the most recent on the stack. This page does a good job of explaining: https://www.geeksforgeeks.org/dsa/introduction-to-stack-data-structure-and-algorithm-tutorials/ Edit: you can also see this reflected in the Alt-text: I NOTATION POLISH REVERSE ❤️
minus-squaredavidgro@lemmy.worldlinkfedilinkarrow-up4·edit-21 month agoHuh, it’s that buffer thing that I didn’t know about and isn’t mentioned in your link (maybe it’s Forth specific?), I use an RPN calculator app, but everything goes on the stack, so “This” would be on the bottom and be popped off last.
minus-squarelad@programming.devlinkfedilinkEnglisharrow-up2·1 month agoIt looks to me that it is either Forth, or implementation specific, not RPN in general. But then again, the meme is about Forth, not RPN
minus-squareAVincentInSpace@pawb.sociallinkfedilinkEnglisharrow-up2arrow-down1·1 month agoMy guess is that POLISH and REVERSE modify the top stack element immediately
This
great
is
one
+
+
+
!
Thisgreatisone! ?
If the operands go the other way, I suppose:
oneisgreatThis!
The stack doesn’t quite work like that. They would get added like this:
This > buffer
great, is, one > stack
Then, each + pulls the latest off the stack and operates.
First + would pull ‘one’ as it’s the most recent on the stack.
This page does a good job of explaining: https://www.geeksforgeeks.org/dsa/introduction-to-stack-data-structure-and-algorithm-tutorials/
Edit: you can also see this reflected in the Alt-text:
I NOTATION POLISH REVERSE ❤️Huh, it’s that buffer thing that I didn’t know about and isn’t mentioned in your link (maybe it’s Forth specific?), I use an RPN calculator app, but everything goes on the stack, so “This” would be on the bottom and be popped off last.
Did Randall get this one wrong?
It looks to me that it is either Forth, or implementation specific, not RPN in general. But then again, the meme is about Forth, not RPN
My guess is that POLISH and REVERSE modify the top stack element immediately