Changeset 6682 for lang/scala/sandbox

Show
Ignore:
Timestamp:
02/14/08 21:02:09 (10 months ago)
Author:
keisuken
Message:

whileEach to whileLoop

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/scala/sandbox/src/jp/ne/cappuccino/keisuken/scl/lang/Loop.scala

    r6681 r6682  
    3030  } 
    3131 
    32   def whileEach(cond: => Boolean)(p: Break => Unit): Unit = { 
     32  def whileLoop(cond: => Boolean)(p: Break => Unit): Unit = { 
    3333    val break = new Break() 
    3434    while(break.cond && cond) p(break) 
     
    4242  } 
    4343 
    44   def doWhileEach(cond: => Boolean)(p: Break => Unit): Unit = { 
     44  def doWhile(cond: => Boolean)(p: Break => Unit): Unit = { 
    4545    val break = new Break() 
    4646    do p(break) while(break.cond && cond) 
     
    6464 
    6565    var i = 0 
    66     whileEach(i < 10) {break => 
     66    whileLoop(i < 10) {break => 
    6767      if(i >= 5) { 
    6868        println(i) 
     
    7373 
    7474    i = 0 
    75     doWhileEach({i += 1; i < 10}) {break => 
     75    doWhile({i += 1; i < 10}) {break => 
    7676      if(i >= 5) { 
    7777        println(i)