Conversation
Notices
-
Embed this notice
feld (feld@friedcheese.us)'s status on Friday, 30-Aug-2024 23:10:02 JST feld
Recovering from reading some HN comment saying that Elixir supporting multiple function heads is worse than just putting a giant case statement at the beginning of the function
disturbing-
Embed this notice
feld (feld@friedcheese.us)'s status on Friday, 30-Aug-2024 23:12:48 JST feld
@mischievoustomato multiple functions with the same name, first match wins
you do pattern matching in the args given to the function
def is_cool?(%{user: feld}), do: true
def is_cool(_), do: false -
Embed this notice
Johnny Peligro, now on Mitra! (mischievoustomato@mitra.taihou.website)'s status on Friday, 30-Aug-2024 23:12:51 JST Johnny Peligro, now on Mitra!
@feld what does multiple function heads mean
-
Embed this notice