The latest message here was more than a year ago, but the topic is still 
actual.

I think, what we need here is the mandatory function which uses whatever 
values passed to %Struct{}.

I.e., I need to enforce integrity of a newly created structure - so this 
mandatory function gets called. Structure is immutable - so when we change 
it, brand new structure gets created and, again, this function gets called.

Maybe use callback here? Say, default callback just returns the struct. But 
being overridden, it can contain any validation logic needed. 

-- 
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/7ea141b5-a659-49d0-ab21-3c1d9c4cb379%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to