Quantcast
Channel: Variable assignment in Elixir - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by Vincent Gerris for Variable assignment in Elixir

$
0
0

An attempt to actually answer the question, using knowledge from the link. Elixir does not do matching with the = operator , it does something called rebinding. The code example shows how Elixir can be made to behave like Erlang, which is completely illogical to me as a total new user of the language. I hope to revisit this answer in the future to write something better :).

So Elixir uses pattern matchin when the variable is preceded with a ^ instead of rebinding. My question is : in a big piece of code how those one keep track of first use and use this notation?It would be great if anyone can provide a good answer to that :).


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>