dojo-toulouse / elixir-koans

Small exercises to discover elixir by testing
249 stars 61 forks source link

Small fixes on how we think about enums #26

Closed frojasg closed 8 years ago

frojasg commented 8 years ago
frojasg commented 8 years ago

I don't have a problem to change the function syntax. Could you elaborate a little bit why do you prefer this style please. Thanks

apieum commented 8 years ago

Yes of course, I prefer the fn syntax because it is easier to understand for someone learning elixir. It makes clear that you need a function as the second argument (which is how it is documented). When you don't know elixir it's not obvious that &(&1 == 2) is a function.

Even if &(&1 == 2) is more idiomatic of elixir than "fn" the point here is just to learn about enum, and I think it is better to point the & idiom when learning about functions. ;)

frojasg commented 8 years ago

it makes a lot of sense. Thanks for the feedback

frojasg commented 8 years ago

@apieum Could you take a look now please. Thanks!

apieum commented 8 years ago

It's perfect for me, thanks a lot.