- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
scala.util.control.Breaks.continue
Mon, 2009-05-11, 00:34
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
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
Thu, 2009-05-14, 10:37
#2
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:
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
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