News for hackers. Stuff that matters.
Re:Shell Scripting with Elixir by irjoe on Tuesday February 13, 2024 @05:02AM (#39356170)
You can also use anonymous functions if you find the module syntax a little terse or clunky for shell scripting.

    double = fn a -> add.(a, a) end
    double.(4)
It starts to look a bit like a weird untyped OCaml / F# if you use pattern matching:

    f = fn
      x, y when x > 0 -> x + y
      x, y -> x * y
    end

There are no comments on this comment yet.