Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

14-modules-and-structs wrong output #124

Open
Samuei2000 opened this issue Jun 21, 2023 · 0 comments
Open

14-modules-and-structs wrong output #124

Samuei2000 opened this issue Jun 21, 2023 · 0 comments

Comments

@Samuei2000
Copy link

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant