You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So i just read the only other issue that it's about the same val :). I've also been using the wrong term - map instead of tuple. Lots to learn.
In the comment on that issue, it is mentioned that {:inches, inches} = val will pattern match such that the second value in val will be bound to inches as long as :inches is the first element. Makes sense, but then why is Elixir giving me a warning?
val is the same as the tuple on the left. It is unused, so redundant here. But it could be useful if the function needed the whole tuple, not only its part, e.g., to pass it to another function:
Just started working through this book and it's been great so far!
A quick question on this example though --
What is
val
(in the functional argument) used for? When I run the tests, I get this warning:What is the point of
val
in this example? Also, isval
bound to the map that is passed as argument?Thanks!
The text was updated successfully, but these errors were encountered: