Skip to content

Purpose/expectation of the first struct koan is unclear #286

Open
@cincodenada

Description

@cincodenada

Hello, I am running through the koans as my introduction to Elixir, and so far it's been quite nice! I'm a bit confused as to what the purpose of the first structs koan is:

  koan "Structs are defined and named after a module" do
    person = %Person{}
    assert person == ___
  end

I started with %{name: nil, age: nil} which of course told me that it wasn't a Structs.Person, so I went with %Person{name: nil, age: nil} which worked, as does %Person{} which...I guess demonstrates that struct equality is based on membership rather than (what I would call) instances? And actually I just went back and discovered that it is even threequal, which is unexpected!

Perhaps this first koan should be something about member equality? It just felt out of step with the rest of the koans to this point, which were pretty clear about what they were demonstrating and what I was expected to fill it in with.

(For context, I'm a fairly experienced developer who spends most of my time in things like Javascript and Python but have wandered far afield, I've enjoyed Rust and Racket and bounced off of Haskell a while back)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions