Re: [elixir-core:8402] Re: Proposal: Inspect for records

2018-12-16 Thread José Valim
Note that both IEx and ExUnit already keep a wrapper around inspect as they do provide default inspecting values, so the explicit approach sounds like the way to go IMO. *José Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Director of R On Sun, Dec 16, 2018 at 9:14 PM wrote: > >

Re: [elixir-core:8402] Re: Proposal: Inspect for records

2018-12-16 Thread wojtek . mach
> Couldn't you define a method like __record_keys__/0 on the atom in the defrecord call? Yes. To be concrete, this is how it could work: ``` defmodule Records do import Record defrecord :a, [:x, :y] defrecord :b, [:x, :y] end iex> Records.__records__() [ a: [:x, :y], b: [:x, :y] ]

Re: [elixir-core:8400] Re: Proposal: Inspect for records

2018-12-16 Thread Louis Pilfold
Hey Unlike structs there's no guarantee that two records won't be defined with the same name, they are scoped within modules. Cheers, Louis On Sun, 16 Dec 2018 at 13:55 Allen Madsen wrote: > Couldn't you define a method like __record_keys__/0 on the atom in the > defrecord call? > > Allen

Re: [elixir-core:8399] Re: Proposal: Inspect for records

2018-12-16 Thread Allen Madsen
Couldn't you define a method like __record_keys__/0 on the atom in the defrecord call? Allen Madsen http://www.allenmadsen.com On Sat, Dec 15, 2018 at 11:49 AM wrote: > One way to avoid issues with state is to avoid... state. Maybe we'd > configure it like this: > > records = [ > # explicit