Changeset 6682 for lang/scala
- Timestamp:
- 02/14/08 21:02:09 (10 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/scala/sandbox/src/jp/ne/cappuccino/keisuken/scl/lang/Loop.scala
r6681 r6682 30 30 } 31 31 32 def while Each(cond: => Boolean)(p: Break => Unit): Unit = {32 def whileLoop(cond: => Boolean)(p: Break => Unit): Unit = { 33 33 val break = new Break() 34 34 while(break.cond && cond) p(break) … … 42 42 } 43 43 44 def doWhile Each(cond: => Boolean)(p: Break => Unit): Unit = {44 def doWhile(cond: => Boolean)(p: Break => Unit): Unit = { 45 45 val break = new Break() 46 46 do p(break) while(break.cond && cond) … … 64 64 65 65 var i = 0 66 while Each(i < 10) {break =>66 whileLoop(i < 10) {break => 67 67 if(i >= 5) { 68 68 println(i) … … 73 73 74 74 i = 0 75 doWhile Each({i += 1; i < 10}) {break =>75 doWhile({i += 1; i < 10}) {break => 76 76 if(i >= 5) { 77 77 println(i)
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)