Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
irjoe
on June 30, 2019
|
parent
|
context
|
favorite
| on:
Programming Patterns I Like
Quite the opposite :) My preference would be to rely on pattern matching (unification) in the function head:
def transform_data([_|[]]) do: []
I just wanted an example of using guard clauses. It does depend on the actual code though, there's probably a more elixiry solution.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: