GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    Andrew Kelley (andrewrk@mastodon.social)'s status on Tuesday, 05-Nov-2024 08:16:00 JST Andrew Kelley Andrew Kelley

    Lately my Zig code has started to look like this in all my projects

    https://ziglang.org/devlog/2024/#2024-11-04

    In conversation about 8 months ago from mastodon.social permalink

    Attachments


    1. https://files.mastodon.social/media_attachments/files/113/427/109/102/315/958/original/1cf562dabb028697.png
    • Embed this notice
      Andrew Kelley (andrewrk@mastodon.social)'s status on Tuesday, 05-Nov-2024 08:15:54 JST Andrew Kelley Andrew Kelley
      in reply to
      • Joseph Humfrey

      @joethephish I understand the appeal to such a thing, however, the flexibility of having it also be a namespace is extremely useful, as you can see from the two examples at the end

      In conversation about 8 months ago permalink
    • Embed this notice
      clarity flowers (clarity@xoxo.zone)'s status on Tuesday, 05-Nov-2024 08:15:54 JST clarity flowers clarity flowers
      in reply to
      • Joseph Humfrey

      @andrewrk @joethephish. I also use this technique constantly. It's similar to how I'll wrap a C library's pointers in my own namespaces. Feels like what I'd actually want is a "namespaced primitive", so the value automatically coerces to u32 without needing an `enumToInt` but can also have a namespace + functions, etc.

      In conversation about 8 months ago permalink
    • Embed this notice
      Joseph Humfrey (joethephish@mastodon.gamedev.place)'s status on Tuesday, 05-Nov-2024 08:16:00 JST Joseph Humfrey Joseph Humfrey
      in reply to

      @andrewrk Yeah I’ve done the same with enums in C#, it works great! Though it feeeeels slightly hacky?

      I think some languages have that as keyword, a bit like a type alias but not allowing it to be interchangeable with the original. Maybe “distinct”? (I’m sure you know about this as a thing much better than me!)

      In conversation about 8 months ago permalink
    • Embed this notice
      Andrew Kelley (andrewrk@mastodon.social)'s status on Tuesday, 12-Nov-2024 10:57:04 JST Andrew Kelley Andrew Kelley
      in reply to
      • segfault

      @segfault https://ziglang.org/documentation/0.13.0/#Non-exhaustive-enum

      In conversation about 8 months ago permalink

      Attachments

      1. No result found on File_thumbnail lookup.
        Documentation - The Zig Programming Language
      Haelwenn /элвэн/ :triskell: likes this.
    • Embed this notice
      segfault (segfault@class.lunanova.dev)'s status on Tuesday, 12-Nov-2024 10:57:05 JST segfault segfault
      in reply to
      @andrewrk What does the empty underscore do in the enums do? What does discarding the value do?
      In conversation about 8 months ago permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.