15 Oct 21:56
The continue keyword
From: Harshad <harshad.rj <at> gmail.com>
Subject: The continue keyword
Newsgroups: gmane.comp.lang.scala
Date: 2008-10-15 19:59:29 GMT
Subject: The continue keyword
Newsgroups: gmane.comp.lang.scala
Date: 2008-10-15 19:59:29 GMT
Hi,
Would it be possible to add support for the "continue" keyword? Note: there
has been discussion on a similar topic before [1]. But that dealt
with "continue" _and_ "break". From my limited knowledge it appears
that "continue" by itself should be much more straight forward to implement
than "break". We just need to jump to the position after the last operation
in the closest surrounding Unit (?)
Even if "break" is not actually supported, it might be easier to
emulate "break" when "continue" is supported. Eg,
// Java code
while (!done) {
if (x) {
if (y)
break;
}
if (z)
// blah blah
}
// Scala equivalent without continue / break
while (!done) {
var yHit = false
if (x) {
if (y) {
yHit = true
done = true
}
(Continue reading)
It is
RSS Feed