Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Uncategorized
  3. Look what I found

Look what I found

Scheduled Pinned Locked Moved Uncategorized
49 Posts 37 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • System FaultE System Fault

    Look what I found

    Here: http://pigeonsnest.co.uk/stuff/pigeons-device.html

    Michael EngelM This user is from outside of this forum
    Michael EngelM This user is from outside of this forum
    Michael Engel
    wrote last edited by
    #8

    @error Duff's device all over again. Nice!

    1 Reply Last reply
    0
    • System FaultE System Fault

      Look what I found

      Here: http://pigeonsnest.co.uk/stuff/pigeons-device.html

      Ken McLeod_ This user is from outside of this forum
      Ken McLeod_ This user is from outside of this forum
      Ken McLeod
      wrote last edited by
      #9

      @error /me sets mode = 3, chuckling

      System FaultE 1 Reply Last reply
      0
      • Ken McLeod_ Ken McLeod

        @error /me sets mode = 3, chuckling

        System FaultE This user is from outside of this forum
        System FaultE This user is from outside of this forum
        System Fault
        wrote last edited by
        #10

        @_the_cloud Yeah, but if you click the link, they actually use default case there.

        poleguy looking for lost toolsP 1 Reply Last reply
        0
        • System FaultE System Fault

          Look what I found

          Here: http://pigeonsnest.co.uk/stuff/pigeons-device.html

          unlofl [Promoted Toot]U This user is from outside of this forum
          unlofl [Promoted Toot]U This user is from outside of this forum
          unlofl [Promoted Toot]
          wrote last edited by
          #11

          @error I'm calling the police

          1 Reply Last reply
          0
          • System FaultE System Fault

            Look what I found

            Here: http://pigeonsnest.co.uk/stuff/pigeons-device.html

            MichaelM This user is from outside of this forum
            MichaelM This user is from outside of this forum
            Michael
            wrote last edited by
            #12

            @error that's wild. I wonder how this would be treated by different formatters/style enforcers and if it would break

            System FaultE 1 Reply Last reply
            0
            • System FaultE System Fault

              Look what I found

              Here: http://pigeonsnest.co.uk/stuff/pigeons-device.html

              Marc B. ReynoldsM This user is from outside of this forum
              Marc B. ReynoldsM This user is from outside of this forum
              Marc B. Reynolds
              wrote last edited by
              #13

              @error At the time this was written (for hardware & compilers were pre SSA) this could have been reasonable.

              1 Reply Last reply
              0
              • System FaultE System Fault

                Look what I found

                Here: http://pigeonsnest.co.uk/stuff/pigeons-device.html

                mmu_manM This user is from outside of this forum
                mmu_manM This user is from outside of this forum
                mmu_man
                wrote last edited by
                #14

                @error yup that's how Contiki implemented Protothreads initially:

                https://dunkels.com/adam/pt/

                ewhacE 1 Reply Last reply
                0
                • System FaultE System Fault

                  Look what I found

                  Here: http://pigeonsnest.co.uk/stuff/pigeons-device.html

                  Vaporeon :vaporeon:V This user is from outside of this forum
                  Vaporeon :vaporeon:V This user is from outside of this forum
                  Vaporeon :vaporeon:
                  wrote last edited by
                  #15

                  @error That's super neat, I didn't know! I'll probably use this in my code at a some point...

                  System FaultE 1 Reply Last reply
                  0
                  • System FaultE System Fault

                    Look what I found

                    Here: http://pigeonsnest.co.uk/stuff/pigeons-device.html

                    mage_of_dragonsM This user is from outside of this forum
                    mage_of_dragonsM This user is from outside of this forum
                    mage_of_dragons
                    wrote last edited by
                    #16

                    @error this should be classified as an infohazard

                    1 Reply Last reply
                    0
                    • System FaultE System Fault

                      Look what I found

                      Here: http://pigeonsnest.co.uk/stuff/pigeons-device.html

                      Ype KingmaK This user is from outside of this forum
                      Ype KingmaK This user is from outside of this forum
                      Ype Kingma
                      wrote last edited by
                      #17

                      @error

                      Three lines too many. I thought serious programmers were lazy.

                      SteveF 1 Reply Last reply
                      0
                      • System FaultE System Fault

                        Look what I found

                        Here: http://pigeonsnest.co.uk/stuff/pigeons-device.html

                        The Penguin of EvilE This user is from outside of this forum
                        The Penguin of EvilE This user is from outside of this forum
                        The Penguin of Evil
                        wrote last edited by
                        #18

                        @error It's an utter pain in the arse when writing a compiler too, and even worse is when goto gets involved.

                        1 Reply Last reply
                        0
                        • MichaelM Michael

                          @error that's wild. I wonder how this would be treated by different formatters/style enforcers and if it would break

                          System FaultE This user is from outside of this forum
                          System FaultE This user is from outside of this forum
                          System Fault
                          wrote last edited by
                          #19

                          @mikee I actually tried it. It works just fine to my surprise. But the clangd formatter gone mad:

                          MichaelM h3mmy :v_enby:H 2 Replies Last reply
                          0
                          • System FaultE System Fault

                            @_the_cloud Yeah, but if you click the link, they actually use default case there.

                            poleguy looking for lost toolsP This user is from outside of this forum
                            poleguy looking for lost toolsP This user is from outside of this forum
                            poleguy looking for lost tools
                            wrote last edited by
                            #20

                            @error @_the_cloud Only in the original example, not in the first two. I'd set it to 3 and chuckle too. I'm an FPGA guy, so I always think about else/default.

                            1 Reply Last reply
                            0
                            • System FaultE System Fault

                              Look what I found

                              Here: http://pigeonsnest.co.uk/stuff/pigeons-device.html

                              poleguy looking for lost toolsP This user is from outside of this forum
                              poleguy looking for lost toolsP This user is from outside of this forum
                              poleguy looking for lost tools
                              wrote last edited by
                              #21

                              @error gloop, arfle, barfle says it all.

                              1 Reply Last reply
                              0
                              • System FaultE System Fault

                                @mikee I actually tried it. It works just fine to my surprise. But the clangd formatter gone mad:

                                MichaelM This user is from outside of this forum
                                MichaelM This user is from outside of this forum
                                Michael
                                wrote last edited by
                                #22

                                @error ha! Thanks for testing!

                                1 Reply Last reply
                                0
                                • System FaultE System Fault

                                  Look what I found

                                  Here: http://pigeonsnest.co.uk/stuff/pigeons-device.html

                                  Scott :mbta_glx:S This user is from outside of this forum
                                  Scott :mbta_glx:S This user is from outside of this forum
                                  Scott :mbta_glx:
                                  wrote last edited by
                                  #23

                                  @error it's beautiful

                                  1 Reply Last reply
                                  0
                                  • System FaultE System Fault

                                    Look what I found

                                    Here: http://pigeonsnest.co.uk/stuff/pigeons-device.html

                                    Malcolm HerbertM This user is from outside of this forum
                                    Malcolm HerbertM This user is from outside of this forum
                                    Malcolm Herbert
                                    wrote last edited by
                                    #24

                                    @error reminds me of Duff's Device for abitrary length byte copy using the switch as an index into an architecture-appropriate unrolled loop https://en.wikipedia.org/wiki/Duff%27s_device

                                    1 Reply Last reply
                                    0
                                    • Vaporeon :vaporeon:V Vaporeon :vaporeon:

                                      @error That's super neat, I didn't know! I'll probably use this in my code at a some point...

                                      System FaultE This user is from outside of this forum
                                      System FaultE This user is from outside of this forum
                                      System Fault
                                      wrote last edited by
                                      #25

                                      @vaporeon_ please don't 😃

                                      1 Reply Last reply
                                      0
                                      • System FaultE System Fault

                                        Look what I found

                                        Here: http://pigeonsnest.co.uk/stuff/pigeons-device.html

                                        Western InfidelsW This user is from outside of this forum
                                        Western InfidelsW This user is from outside of this forum
                                        Western Infidels
                                        wrote last edited by
                                        #26

                                        @error I don't think I ever would have tried to pass that off, myself, but I sort of admire the fact that, even though it's language abuse, it produces a predictable outcome. C has a lot of undefined behavior, but somehow, this isn't.

                                        I think I tried to use Duff's Device in a project once, but my colleagues objected and made me change it. Or maybe I just explained Duff's Device to them and they were horrified. Like, "I don't know if I can trust that guy anymore" horrified. It was a long time ago.

                                        This is interesting but it's not really saving a ton of time or code space. I think Duff's Device is probably more defensible.

                                        System FaultE 1 Reply Last reply
                                        0
                                        • System FaultE System Fault

                                          Look what I found

                                          Here: http://pigeonsnest.co.uk/stuff/pigeons-device.html

                                          ewhacE This user is from outside of this forum
                                          ewhacE This user is from outside of this forum
                                          ewhac
                                          wrote last edited by
                                          #27

                                          @error @TomDuff, call your office...

                                          Tom DuffT 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          Powered by NodeBB Contributors
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups