Skip to content

14-modules-and-structs wrong output #124

@Samuei2000

Description

@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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions