My Lemmy
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@suppo.fi to Programmer Humor@programming.dev · 2 days ago

Forth

suppo.fi

message-square
14
link
fedilink
135

Forth

suppo.fi

cm0002@suppo.fi to Programmer Humor@programming.dev · 2 days ago
message-square
14
link
fedilink

https://xkcd.com/3277/

  • davidgro@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    2 days ago

    Thisgreatisone! ?

    If the operands go the other way, I suppose:

    oneisgreatThis!

    • otacon239@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      2 days ago

      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 ❤️
      
      • davidgro@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        edit-2
        2 days ago

        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.

        • otacon239@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          2 days ago

          Did Randall get this one wrong?

          • lad@programming.dev
            link
            fedilink
            English
            arrow-up
            2
            ·
            23 hours ago

            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

          • AVincentInSpace@pawb.social
            link
            fedilink
            English
            arrow-up
            2
            arrow-down
            1
            ·
            2 days ago

            My guess is that POLISH and REVERSE modify the top stack element immediately

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 765 users / day
  • 4.14K users / week
  • 4.24K users / month
  • 4.26K users / 6 months
  • 1 local subscriber
  • 32.7K subscribers
  • 120 Posts
  • 1.05K Comments
  • Modlog
  • mods:
  • adr1an@programming.dev
  • Feyter@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.20
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org