Changeset 6679 for lang/scala
- Timestamp:
- 02/14/08 20:28:08 (5 years ago)
- Location:
- lang/scala/sandbox
- Files:
-
- 3 modified
-
lib/scala-sandbox.jar (modified) (previous)
-
src/jp/ne/cappuccino/keisuken/scl/lang/Loop.scala (modified) (4 diffs)
-
webpages/lib/scala-sandbox.jar (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
lang/scala/sandbox/src/jp/ne/cappuccino/keisuken/scl/lang/Loop.scala
r6678 r6679 39 39 40 40 var i = 0 41 findWhile[Int](true) {break =>41 var result1 = findWhile[Int](true) {break => 42 42 if(i >= 5) 43 43 break(i) 44 44 else 45 45 i += 1 46 } match { 46 } 47 result1 match { 47 48 case Some(result) => println(result) 48 49 case None => println("Not found") … … 50 51 51 52 i = 0 52 findWhile[Int](i < 10) {break =>53 val result2 = findWhile[Int](i < 10) {break => 53 54 if(i == 20) 54 55 break(i) 55 56 else 56 57 i += 1 57 } match { 58 } 59 result2 match { 58 60 case Some(result) => println(result) 59 61 case None => println("Not found") … … 61 63 62 64 i = 0 63 findDoWhile[Int]({i += 1; i < 10}) {break =>65 val result3 = findDoWhile[Int]({i += 1; i < 10}) {break => 64 66 if(i == 5) break(i) 65 } match { 67 } 68 result3 match { 66 69 case Some(result) => println(result) 67 70 case None => println("Not found") 68 71 } 69 72 70 val result = foreach[String, String](73 val result4 = foreach[String, String]( 71 74 Array("aaa", "bbb", "ccc")) {(value, break) => 72 75 if(value.equals("ddd")) 73 76 break(value) 74 77 } 75 println(result )78 println(result4) 76 79 77 foreach[String,String](Array("aaa", "bbb", "ccc")) {(value, break) => 80 val result5 = foreach[String,String](Array("aaa", "bbb", "ccc")) 81 {(value, break) => 78 82 if(value.equals("bbb")) 79 83 break(value) … … 83 87 } 84 88 85 foreach[Int,Int](1 to 10) {(i, break) =>89 val result6 = foreach[Int,Int](1 to 10) {(i, break) => 86 90 if(i % 2 == 1) break(i) 87 } match { 91 } 92 result6 match { 88 93 case Some(result) => println(result) 89 94 case None => println("Not found")
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)