If the goal were primarily macro usage, wouldn't this type of thing already be possible with a macro today?
Allen Madsen http://www.allenmadsen.com On Mon, Sep 24, 2018 at 11:34 AM Christopher Keele <[email protected]> wrote: > That's a good point. I suspect the convention around manual usage would > converge around: > > *def foo(%{x: x} = result when x > 1), do: 1* > > which parses as expected. This version feels more natural to me. > > I don't think the other form would accidentally be introduced while > injecting one snippet of AST, because the tree would never be constructed > the wrong way. String-based expression interpolation might make that > mistake, but if you're metaprogramming with literal strings of code you've > already made a mistake. > > I hadn't typed out an assignment case with inline guards, it does feel > like it's doing too much in a short space with few grammar tokens to help > understand it. That's a good argument for intentionally discouraging these > constructs outside of metaprogramming, rather than adopting it as a common > usage language feature. > > -- > 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/f2fafacb-3302-4c03-9b1b-ed766a896cc2%40googlegroups.com > <https://groups.google.com/d/msgid/elixir-lang-core/f2fafacb-3302-4c03-9b1b-ed766a896cc2%40googlegroups.com?utm_medium=email&utm_source=footer> > . > 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAK-y3CsZJV4WXp5mtSqMtxZ_%3DXHoytyGmKET8pDXWQutUax9Ng%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
