For example instead of

defmodule Foo do

    @enforce_keys [:foo1, :foo2] 

    defstruct [:foo1, :foo2, :foo3] 

 end


I write

defmodule Foo do 

    @required_keys [:foo1, :foo2] 

    @optional_keys [:foo3] 

    @enforce_keys @required_keys 

    defstruct @required_keys ++ @optional_keys 

 end


But I think it could better be
 

> defmodule Foo do 

    defrequired [:foo1, :foo2]

    defoptional [:foo3] 

 end 

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/f84f2f1a-e04b-4673-a88b-b35c9f9fa482%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to