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
    ✧✦Catherine✦✧ (whitequark@mastodon.social)'s status on Monday, 22-Sep-2025 12:42:06 JST ✧✦Catherine✦✧ ✧✦Catherine✦✧

    one of my favorite Go language facts is that this is valid code and it works exactly how you'd expect it to https://go.dev/play/p/GDvuN8xZT7-

    In conversation about 5 months ago from mastodon.social permalink

    Attachments


    1. https://files.mastodon.social/media_attachments/files/115/245/873/068/759/812/original/e29d38d8038398a8.png
    2. Domain not in remote thumbnail source whitelist: go.dev
      Go Playground - The Go Programming Language
    • Embed this notice
      ✧✦Catherine✦✧ (whitequark@mastodon.social)'s status on Monday, 22-Sep-2025 12:43:08 JST ✧✦Catherine✦✧ ✧✦Catherine✦✧
      in reply to

      more languages should have total symmetry between input parameters and output parameters; we have toiled under the tyranny of C-likes

      In conversation about 5 months ago permalink
    • Embed this notice
      ✧✦Catherine✦✧ (whitequark@mastodon.social)'s status on Monday, 22-Sep-2025 12:44:15 JST ✧✦Catherine✦✧ ✧✦Catherine✦✧
      in reply to

      once i found out about this syntax i was able to get rid of quite a few `var err error` that i had sprinkled around the more complex functions. very nice feature

      In conversation about 5 months ago permalink
    • Embed this notice
      Glyph (glyph@mastodon.social)'s status on Monday, 22-Sep-2025 13:03:31 JST Glyph Glyph
      in reply to

      @whitequark I do not know Go and I hate that I like this

      In conversation about 5 months ago permalink
    • Embed this notice
      cliffordheath (cliffordheath@mastodon.social)'s status on Monday, 22-Sep-2025 14:50:39 JST cliffordheath cliffordheath
      in reply to

      @whitequark I have written Go professionally and I don't know what to expect this code to do. Are even those bool's passed by reference? I don't like the idea that any callee could change anything I pass. (TBF I don't claim to have mastered Go, or even to have used more than half of it)

      In conversation about 5 months ago permalink
    • Embed this notice
      ✧✦Catherine✦✧ (whitequark@mastodon.social)'s status on Monday, 22-Sep-2025 15:21:49 JST ✧✦Catherine✦✧ ✧✦Catherine✦✧
      in reply to
      • J. "Henry" Waugh

      @jhwgh1968 which bit are you talking about?

      In conversation about 5 months ago permalink
    • Embed this notice
      J. "Henry" Waugh (jhwgh1968@chaos.social)'s status on Monday, 22-Sep-2025 15:21:51 JST J. "Henry" Waugh J. "Henry" Waugh
      in reply to

      @whitequark personally I'd be a lot more jazzed about it if it didn't create a common code pattern as standard which is IMO the third worst way to propagate errors

      In conversation about 5 months ago permalink
    • Embed this notice
      ✧✦Catherine✦✧ (whitequark@mastodon.social)'s status on Monday, 22-Sep-2025 15:24:52 JST ✧✦Catherine✦✧ ✧✦Catherine✦✧
      in reply to
      • cliffordheath

      @cliffordheath Go doesn't have references like C++ (almost nothing does really...); there are two things happening in here.
      1. the three results are given names. in the context where this is likely the most useful, interface declarations, the names have no semantic meaning
      2. this is a normal function, so there is a semantics. the variables `t`, `before`, `after` appear in the local scope of the function (just like arguments, but always zeroed), and the argument of `return` may be omitted

      In conversation about 5 months ago permalink
    • Embed this notice
      ✧✦Catherine✦✧ (whitequark@mastodon.social)'s status on Monday, 22-Sep-2025 15:27:04 JST ✧✦Catherine✦✧ ✧✦Catherine✦✧
      in reply to
      • cliffordheath

      @cliffordheath I think that in a language that lacks ADTs and keyword arguments and has a bad habit of using the `bool` type, at least having lightweight syntax to name them in return values is extremely important. the `return` trick is sometimes nice when you're wrangling lots of error handling and it is best written in a stateful way

      In conversation about 5 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.