Comment

Comment by irjoe

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
parent irjoe 2 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton