On Thursday, September 27, 2018 at 5:18:15 PM UTC-6, Christopher Keele wrote: > > >> This proposal would also allow an expansion of `defguard` to cover my >> previous recommended functionality to it as well > > > Do you mind expanding on this, Overmind? >
When `defguard` was initially being added I proposed that it should handle both a matcher and a guard and that it should be used in matcher placement like via `def blah(is_person(age: age)) when age>18` or so forth, it allowed for both variable binding so you could pull data 'out' of the match (via positional or named arguments), in addition it would have required `def` to do precisely what this proposal does, which is to distribute the `when`'s from inside the arguments to be added to main guard section of the function head. I made a mini-library with 'just' enough functionality to demonstrate how it would work (overwriting `def` with my own version where it was `use`d). -- 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/31d499c3-226a-4f56-9b4c-a1ea49234416%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
