Post B2mCFuj6Za2WyroV5E by vikxin@beach.city
 (DIR) More posts by vikxin@beach.city
 (DIR) Post #B2mB4fIVUta5zNRdg0 by futurebird@sauropods.win
       2026-01-29T11:47:24Z
       
       0 likes, 0 repeats
       
       If 10 10 10 + = 30 Is reverse Polish then issum_(i=1 to 3) 10 = 30forward Polish? or just Polish?
       
 (DIR) Post #B2mBV5RKvHumb6Aoqm by vikxin@beach.city
       2026-01-29T11:52:09Z
       
       0 likes, 0 repeats
       
       @futurebird Polish notation requires knowing the exact number of arguments for it to work cleanly, so it'd actually be + + 10 10 10. Being able to do 10 10 10 + = is a weird trick that doesn't actually strictly fit the definition of RPN--addition is a binary operation, so it takes two arguments, and summation itself takes an arbitrary number of arguments, so + = is basically just a special case that consumes the rest of the stack as a sum.
       
 (DIR) Post #B2mBZD7gIeIraGwjku by ligasser@social.epfl.ch
       2026-01-29T11:51:17Z
       
       0 likes, 0 repeats
       
       @futurebird that should be two '+', no?
       
 (DIR) Post #B2mBZEVT9gvRsL5FTM by futurebird@sauropods.win
       2026-01-29T11:52:53Z
       
       0 likes, 0 repeats
       
       @ligasser My only exposure to RPN was my dad's old calculator where you hit the operation then "enter" and it would give the result. I don't know about having + two times?
       
 (DIR) Post #B2mBfXVJR67qX5190q by RogerBW@discordian.social
       2026-01-29T11:54:01Z
       
       0 likes, 0 repeats
       
       @futurebird Addition in the RPN I know takes strictly two parameters, so your first example would be10 10 + 10 + 30 =(Forward) Polish doesn't loop any more that reverse does; it's just= 30 + 10 + 10 10where "+" or "=" means "take the next two arguments and do the thing to them".(Obviously both of these could be expressed differently.)
       
 (DIR) Post #B2mBlt3cDM4v7H5aXg by futurebird@sauropods.win
       2026-01-29T11:55:13Z
       
       0 likes, 0 repeats
       
       @vikxin I'm amazed that Polish notation is a real thing. I thought it was just what my dad called it since it was so confusing and unexpected. Or rather I found it confusing and unexpected.
       
 (DIR) Post #B2mCFuj6Za2WyroV5E by vikxin@beach.city
       2026-01-29T12:00:37Z
       
       0 likes, 0 repeats
       
       @futurebird oh yeah I learned about RPN from my dad too. He has a finance calculator that uses it. But it's a real thing that sees a lot of use in various niche places in computer science, like Forth, which is a programming language that's basically just RPN but with more than just math operations. Likewise, Lisp is somewhat similar to NPN, being prefix based, though it has a lot more parentheses.
       
 (DIR) Post #B2mCR5XMifPxh8ePUu by harce@mastodon.social
       2026-01-29T12:02:38Z
       
       0 likes, 0 repeats
       
       @futurebird @vikxin Im also amazed its a thing, and Im Polish.
       
 (DIR) Post #B2mE4l14XDJRaW1dNQ by jonathanhogg@mastodon.social
       2026-01-29T12:21:00Z
       
       0 likes, 0 repeats
       
       @futurebird I got an (already then old) HP engineering calculator when I was an undergrad 35 years ago and have been using RPN since to the point where I am now largely unable to use a normal infix calculator…On an RPN calculator one would normally type "10 ENTER 10 + 10 +" or 10 ENTER 10 ENTER 10 + +". As I recall, the HPs have a quirk where ENTER doubles as a DUP, so you can type "10 ENTER ENTER ENTER + +".
       
 (DIR) Post #B2mHDLxhM6QSLsEney by mattmcirvin@mathstodon.xyz
       2026-01-29T12:56:10Z
       
       0 likes, 0 repeats
       
       @futurebird Prefix notation, where everything is a function with arguments following the operator, is regular Polish. I think it got the name "Polish" just because English speakers didn't know how to spell or pronounce "Łukasiewicz".Lisp is Polish notation with parentheses, but I think the original idea was that if you always knew the number of arguments, in principle you didn't need parentheses. Same with postfix (RPN).
       
 (DIR) Post #B2mHesn5PHCrzHOvbs by mattmcirvin@mathstodon.xyz
       2026-01-29T13:01:09Z
       
       0 likes, 0 repeats
       
       @futurebird @ligasser "Enter" on RPN calculators puts a number on the stack without doing an operation. So you'd go "10 ENTER 10 + +", or "10 ENTER 10 + 10 +" would also work.
       
 (DIR) Post #B2mJGKTRXnDuVvdJ32 by llewelly@sauropods.win
       2026-01-29T13:19:08Z
       
       0 likes, 0 repeats
       
       @futurebird 10 10 10 +would leave the first 10 untouched on the stack, below the sum 20,  so both the 10 and the 20 would be available for future operations; then you could do, say, * (multiplication), and get 200 , without needing parentheses.the main advocacy line of RPN was that you didn't need parentheses, and that in turn was enabled by each operator having a specific, fixed number of operands, leaving a known sequence of older things untouched on the stack for future use.
       
 (DIR) Post #B2mL2D98Bu8ndrWmlk by IngaLovinde@embracing.space
       2026-01-29T13:38:48Z
       
       0 likes, 0 repeats
       
       @futurebird wouldn't reverse polish be `10 10 + 10 + 30 =` ?Or at least `(10 10 10 +) 30 =`
       
 (DIR) Post #B2mWaSBLtSmPcH65y4 by stevenaleach@sigmoid.social
       2026-01-29T15:48:25Z
       
       0 likes, 0 repeats
       
       @futurebird @ligasser My only exposure is playing with Forth - Any number gets pushed onto the stack, any operator consumes the last two stack elements and pushes the result onto the stack.
       
 (DIR) Post #B2mWoXjE4Lb4s8eyTA by stevenaleach@sigmoid.social
       2026-01-29T15:50:59Z
       
       0 likes, 0 repeats
       
       @futurebird @vikxin I love it 'cause it's easy to implement an interpreter... but actually using it?  Not so much.  Writing a Forth interpreter is fun.  Writing Forth... less fun.