Subject: Re: [scala-user] for-loop vs for-yield loop?
On Tue, Feb 21, 2012 at 21:28, Eric Kolotyluk <eric.kolotyluk@xxxxxxxxx> wrote:
>
>
> On 2012-02-21 10:40 AM, Haoyi Li wrote:
>
> I would say the semantics are pretty simple:
>
> for(...){...} -> foreach
> x = for(...){...} -> map

At any rate, I'd rather drop the no-yield case than the yield case. In
fact, one of the SIPs propose the introduction of a keyword for the
no-yield case ("do"). The yield makes it very clear where the
generators end and the expression starts, which isn't always that
case.

--
Daniel C. Sobral

I travel to the future all the time.

(C)2011 mailinglist-archive.com