14-modules-and-structs wrong output

#124 · open · 0 comments

View on GitHub ↗

Samuei2000

Structs are, simply put, maps with one extra key: a :__struct__ key. We can even define a map ourselves with such a key to prove this: iex> %{__struct__: Person, first_name: "Izzy", last_name: "Bell", birthday: ~D[1987-12-04], location: "home"} %Person{ birthday: ~D[1987-12-04], first_name: "Izzy", last_name: "Bell", **location: ""** } Structs are maps at heart! In this part, location should be **location: "home"**

Comments