Remix.run Logo
▲ stingraycharles 2 hours ago

Reminds me a lot of Elixir actually, which I really enjoyed but was, in the end, not fast enough.

The syntax looks friendly.

Does it have multiple dispatch for functions based on arguments? I always loved how easy that was to do in Haskell and Erlang/Elixir, and missed it in languages like Clojure.

▲masijo 2 hours ago | parent [-]

>missed it in languages like Clojure

I'm not sure about Haskell and Erlang/Elixir since I haven't used them much, but aren't multimethods the Clojure solution for this?

▲stingraycharles 39 minutes ago | parent [-]

Not really, what Haskell / Erlang offer is that you can do pattern matching in the function signature.

So you can, say, have a definition for when the value of n is 0, n is 1, etc.

This is a nice example in Haskell:

   compress :: Eq a => [a] -> [a]
   compress [] = []
   compress [x] = [x]
   compress (x:ys@(y:_))
     | x == y    = compress ys
     | otherwise = x : compress ys
Basically it enables you to use recursion more elegantly.