Live data from Hacker News

Elixir – HUGE Release Coming Soon

genserver.social

81–83 of 83 posts

Re: Elixir – HUGE Release Coming Soon

#81

Earlier quoted context omitted.

> Also you can't pattern match on a function return value IIRC. You definitely can. A function return value is just any other value and you can pattern match on it directly, or with the `case` or `with` constructs.

What would be the correct way to pattern match here? def foo( ), do: "bar" def foo(value), do: value

Use a `case` in the body of the function. Why do you absolutely need to pattern match in the function header?

Re: Elixir – HUGE Release Coming Soon

#82

Earlier quoted context omitted.

> Also you can't pattern match on a function return value IIRC. You definitely can. A function return value is just any other value and you can pattern match on it directly, or with the `case` or `with` constructs.

I think the poster means "you can't pattern match with a function value

I don't see how this would be useful.
Post reply on HN