radar / joyofelixir

A gentle introduction to the Elixir programming language
https://joyofelixir.com
Creative Commons Attribution Share Alike 4.0 International
147 stars 34 forks source link

Chapter 10 finding a key's value example wasn't executed #109

Closed Sinc63 closed 2 years ago

Sinc63 commented 2 years ago

In one example we see:

iex> person = %{"gender" => "Female", "age" => "30ish", "name" => "Izzy"}
%{"age" => "30ish", "gender" => "Izzy", "name" => "Izzy"}

This must have been typed in, rather than executed, because it manages to make Izzy's gender "Izzy"! If it was actually executed it would look like:

iex> person = %{"gender" => "Female", "age" => "30ish", "name" => "Izzy"}
%{"age" => "30ish", "gender" => "Female", "name" => "Izzy"}
radar commented 2 years ago

Thank you for pointing that out! I've now fixed it up.