defmodule Foo do
@enforce_keys [:foo1, :foo2]
defstruct [:foo1, :foo2, :foo3]
end
defmodule Foo do
@required_keys [:foo1, :foo2]
@optional_keys [:foo3]
@enforce_keys @required_keys
defstruct @required_keys ++ @optional_keys
end
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+unsubscribe@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.
Hi there
Perhaps this could be implemented in a library as a macro, rather than introducing a breaking change into the core language :)
Cheers,
Louis
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@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.
--
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-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4LOQBw9SmfHHf21Cvmd%2BOjLtS3p0892Of7u-kmUaqxtXw%40mail.gmail.com.