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

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

Embed Notice

HTML Code

Corresponding Notice

  1. Embed this notice
    Phantasm (phnt@fluffytail.org)'s status on Thursday, 28-May-2026 08:28:36 JSTPhantasmPhantasm
    in reply to
    • Haelwenn /элвэн/ :triskell:
    • Junes
    • DulceKennedy
    • pistolero
    • SilverDeth
    • Slim Jim
    • CMD
    @p @j @Junes @SilverDeth @lanodan @ElDeadKennedy @ceo_of_monoeye_dating
    >We have just added an invariant. We can proceed down the line, gradually narrowing the number of cases we need to deal with instead of branching. You can sort of do this in Elixir but it requires you to name all of the intermediate steps.

    You do this with a cond clause, no need to name anything. Same thing, slightly different syntax.

    cond do
    is_nil(var) -> do_nil(var)
    is_binary(var) -> do_binary(var)
    var == 5 -> do_five(var)
    true -> do_default(var)
    end
    You don't have to call a function after the match either, you can do the processing right after the match. Put this at the bottom of a function and you have the exact same thing.
    In conversationabout 5 months ago from fluffytail.orgpermalink
  • 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.