Thanks everybody for the feedback. Replies below!

> I will say, I'm still not a fan of using new qualifiers. I'm not sure why
we need to introduce a new special form for this,
> since we can do whatever we need to in the macro? What's wrong with:
for count = 0, count < 5, x <- element do {x, count + 1} end

I did consider this. However, using "count = ... " as a filter anywhere
does not change the return type of the comprehension. Why does setting the
variable at the beginning change the return type? Given it has a strong
impact on the return type, I think we need a clearer indicator.

Aso, "var = expr" in a comprehension means that, if expr is false or nil,
then no further code is executed. If we were to keep the semantics, then I
couldn't set an initial accumulator to nil.

In other words, the semantics are just too different for us to rely on the
existing behaviour.

> I really like this, and would be happy with it as is [image: 😁] I have
one thought though, with the way
> that we are already doing a bit of “magic” (I don’t mean that in a
negative way) to map the “let”
> variable to the second element of the tuple, could we support multiple
assignments without the
> tuple in the let?

I also considered this and I think the "multiple lets" and "multiple
reduces" could get confusing. Can I have both? Can I declare them anywhere?
The answer is no. Given you can't combine them and only use them at the
beginning, it feels like having only one is the more appropriate choice.

> I was just wondering how it could be used from EEx/Phoenix templates,
looking at the previous example from Chris:

Phoenix will most likely need to use the implicit accumulator to make this
work. Then it becomes a question to ask the Phoenix team. However, given it
is exclusive to the template, it is probably fine to be implicit.

-- 
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/CAGnRm4%2BmRv0%2BptoVoKSN11y_C%2B56QP1vKBqXVdDFvoZQpqh7qQ%40mail.gmail.com.

Reply via email to