Why not simply `required_keys:` then? It makes the meaning explicit, and removes confusion with allowing nil values.
On Wednesday, May 25, 2016 at 4:58:53 PM UTC+1, José Valim wrote: > > I like this feature a lot, but dislike the term enforce. IMO, it muddies >> things and is much less clear than require. In my experience, the term >> required is generally used to indicate fields that must be present. For >> example, JSON schema uses that term. enforce gives me the sense that >> some kind of validation policy is applied but does not describe what the >> validation policy is. Does it enforce the type of values allowed for the >> named fields? Does it enforce the fields are present? Does it enforce the >> named fields are *not* present? Does enforce: [:percent] validate that >> percent is between 1 and 100? >> > That's a very good point. I believe :require is better than :required > (thanks for that) but I still believe the require/required connotation can > be confusing. Also require may be a bit overloaded in Elixir (given the > require special form and Code.require_file). Can you think of other > options? :) > > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/2fb3c50c-6781-4ff6-9379-869719a92e59%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
