Is Joe Armstrong kidding?
pragprog.com
Is Joe Armstrong kidding?
1–4 of 4 posts
Re: Is Joe Armstrong kidding?
#2Re: Is Joe Armstrong kidding?
#3If you check the errata #77244, that's his ONE SINGLE example of how you can use pattern matching with maps. I smiled as I read the example. But when I tried it, boom! That piece of code does not run on any released version of Erlang, and I am here trying out Erlang to see if I can use it in my enterprise project! The most disappointed I have been while learning any language.
count_characters([H|T], #{ H := N }=X) -> …
is not yet fully understood by the VM. More details on this here [1].
Every other line works fine though. Oh and instead of using maps one can use records, dicts, sets, gb_trees, proplists, …[1] http://stackoverflow.com/questions/23106543/illegal-pattern-...
Re: Is Joe Armstrong kidding?
#4If you check the errata #77244, that's his ONE SINGLE example of how you can use pattern matching with maps. I smiled as I read the example. But when I tried it, boom! That piece of code does not run on any released version of Erlang, and I am here trying out Erlang to see if I can use it in my enterprise project! The most disappointed I have been while learning any language.
Yes, the line count_characters([H|T], #{ H := N }=X) -> … is not yet fully understood by the VM. More details on this here [1]. Every other line works fine though. Oh and instead of using maps one can use records, dicts, sets, gb_trees, proplists, … [1] http://stackoverflow.com/questions/23106543/illegal-pattern-...