> Testing, indeed it is not valid there.  :-)
>
> I wonder if it would be worth supporting such a case, I could report it in
> any case, done.  :-)
>

My point is that changing the AST is a slippery slope. I will likely always
find an example that fails because of precedence and mangling.

Hmm, soft-matching operator, makes sense.  Any chance on updating the docs
> at http://elixir-lang.org/docs/stable/elixir/Kernel.
> SpecialForms.html#for/1 where it states "Enumerable generators are
> defined using <-:" to something of that form, maybe like "`<-` matches on
> each given element and skips non-matches", although that still does not
> match how `with` does it.  Hmm, it seems that `for` and `with` are using an
> identical operator in incompatible ways.
>

Improving the docs is a great idea. And again, the skipping or not is
defined by the enclosing with or for. All <- does is to check if something
matches. All you need to know is that the left side is a pattern.


> Hmm, having `when` be directly adjacent to `=` in precedence, what side
> effects would that have?  I do not think that `=` is allowed adjacent to a
> `when` that I can think of in function heads (which are the only other case
> where `when` is used that comes to immediate mind) so no issue there.
>

As mentioned in the previous email, it is related to the precedence of =
and when on the left side of ->. Play with the grammar and let us know if
you can make both "x when y = z" and "x = y when z -> w" work. Maybe if
both operators have the same precedence and are left associative?



-- 


*José Valim*
www.plataformatec.com.br
Skype: jv.ptec
Founder and Director of R&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/CAGnRm4L%2B-TuJLsbC22qjduDzw-WsghUZJqHw%3D3Z_J80wr5-Xpg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to