defstruct foo [
:a,
 property: b , fn  x -> a*2 end
]  

when foo[:b] is called  the function would be invoked by overriding the 
acess operator,
this way you can get more redability in your code than Foo.calculate_b(a) 
and simply overriding fetch on the module

-- 
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/d9b4a1bd-5bc1-48d1-9575-95557e56cc3an%40googlegroups.com.

Reply via email to