Hacker News new | past | comments | ask | show | jobs | submit login

Wait, for loops and nested conditions is an OO concept? What does Elixir do instead?



It seems since Elixir is purely functional you don't mutate things. So basically you use tail call optimised recursion for everything. Neat.


Recursion lol.

Erlang does it too.

If you want to have state you do recursion and call itself with the updated value.

fn me(iter) -> me(iter+1) end


It's not OO per say, but it is an imperative concept, OO is almost always imperative.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: