This page is no longer maintained — Please continue to the home page at www.scala-lang.org

scala.util.control.Breaks.continue

2 replies
Jorge Ortiz
Joined: 2008-12-16,
User offline. Last seen 29 weeks 4 days ago.
Am I missing something, or does "continue" basically never have the semantics of C/Java's "continue"?

Only in very contrived situations (only when using while loops, and only when not also using break) does "continue" have the same semantics as C/Java's "continue". (And even then, it has a sort of "dynamic scoping" thing going on, because of using exceptions, but whatever...)

It's also never used in the standard library.

I'd rather see it gone (or renamed; "repeat", maybe?) than deal with the countless newbie questions of why it doesn't work like Java's "continue".

--j

odersky
Joined: 2008-07-29,
User offline. Last seen 45 weeks 6 days ago.
Re: scala.util.control.Breaks.continue

Hi Jorge,

On Mon, May 11, 2009 at 1:33 AM, Jorge Ortiz wrote:
> Am I missing something, or does "continue" basically never have the
> semantics of C/Java's "continue"?
>
> Only in very contrived situations (only when using while loops, and only
> when not also using break) does "continue" have the same semantics as
> C/Java's "continue". (And even then, it has a sort of "dynamic scoping"
> thing going on, because of using exceptions, but whatever...)
>
> It's also never used in the standard library.
>
> I'd rather see it gone (or renamed; "repeat", maybe?) than deal with the
> countless newbie questions of why it doesn't work like Java's "continue".
>

I believe the code in trunk is not what we decided in the end. Anyone
remember what we decided do do for continue? Was it to drop it
completely or to replace it with something else?

Thanks

Jorge Ortiz
Joined: 2008-12-16,
User offline. Last seen 29 weeks 4 days ago.
Re: scala.util.control.Breaks.continue
I believe the decision was to include break, but not continue:

http://www.nabble.com/Re%3A-continue-keyword-p22569146.html

--j

On Mon, May 11, 2009 at 1:06 AM, martin odersky <martin.odersky@epfl.ch> wrote:
Hi Jorge,



On Mon, May 11, 2009 at 1:33 AM, Jorge Ortiz <jorge.ortiz@gmail.com> wrote:
> Am I missing something, or does "continue" basically never have the
> semantics of C/Java's "continue"?
>
> Only in very contrived situations (only when using while loops, and only
> when not also using break) does "continue" have the same semantics as
> C/Java's "continue". (And even then, it has a sort of "dynamic scoping"
> thing going on, because of using exceptions, but whatever...)
>
> It's also never used in the standard library.
>
> I'd rather see it gone (or renamed; "repeat", maybe?) than deal with the
> countless newbie questions of why it doesn't work like Java's "continue".
>

I believe the code in trunk is not what we decided in the end. Anyone
remember what we decided do do for continue? Was it to drop it
completely or to replace it with something else?

Thanks

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland