You cannot view this unit as you're not logged in yet. Go to Account to login.


  1. sammygadd on November 8, 2020 at 2:03 am

    The first example looks really confusing to me as an Elixir noob. I think it would be a bit easier to understand if the params variables had different names. Overloading them makes things even more confusing. (Or do I completely misunderstand how this works??)

    • Mark Ericksen on November 8, 2020 at 6:08 am

      I’d love to answer your question but I’m not sure I understand it. Are you referring to the example at the “In Pieces and Whole”? Or are you referring to Exercise #1? Which params would you change to improve the clarity?

      • sammygadd on November 9, 2020 at 3:39 am

        I’m referring to the example in “In Pieces and Whole”. The first line declares a params variable. Then the function binds the arguments to another variable also named params.
        At least this is how I understand it. Or are those two variables actually the same?? If not then, to me it would be easier to understand if they had different names to signify that they are different. (A guess simply moving the first line below the function would also help)

        • Mark Ericksen on November 9, 2020 at 4:45 am

          Ah! I see. Thank you for explaining that. The idea with the outer params variable is that it’s like the params you get from Phoenix in a controller from a user POST. They come in with string keys.

          Within the scope of the function do_work, the params argument to the function is different. In this particular case, they would have the same values, but they are different. So yes, I can see that this is confusing. Would it make more sense if the outer params were named phoenix_params or web_params?

          • sammygadd on November 10, 2020 at 12:26 pm

            Yes, for me that makes total sense. I think `web_params` would makes this more clear for noobs like me 🙂

          • Mark Ericksen on November 10, 2020 at 1:02 pm

            Awesome! Thanks for the feedback! I’ve updated the lesson.

  2. Francisco Quintero on November 25, 2020 at 8:30 am

    Awesome exercises. The last one took me a bit because I wasn’t pattern matching in the function definition but when I realized that, it all went downhill to have passing tests.

  3. romenigld on December 12, 2020 at 5:06 pm

    I loved the explanation and again I was having doubts and needed to understand better was this large of pattern matching and your explanation was very helpful for me.
    Just the second exercise I made a mistake on pattern matching and after review the sample of the NestedBinding.award_bonuses function I realized the test with success and the rest was builded more quickly.
    And it wasn’t needed to put the ‘ = _response’ for match the map.
    And your notes are amazing thank you!

Leave a Comment

You must be logged in to post a comment.