Merge remote-tracking branch 'origin/master'

Conflicts:
	compiler/frontend/src/org/jetbrains/jet/lang/resolve/ImportsResolver.java
This commit is contained in:
svtk
2012-01-11 14:23:10 +04:00
5 changed files with 126 additions and 37 deletions
@@ -0,0 +1,30 @@
package bottles
fun box() : String {
var bottles = 10
while (bottles > 0) {
print(bottlesOfBeer(bottles) + " on the wall, ")
println(bottlesOfBeer(bottles) + ".")
print("Take one down, pass it around, ")
if (--bottles == 0) {
println("no more bottles of beer on the wall.")
}
else {
println(bottlesOfBeer(bottles) + " on the wall.")
}
}
return "OK"
}
fun bottlesOfBeer(count : Int) : String {
val result = StringBuilder()
result += count
result += if (count > 1) " bottles of beer" else " bottle of beer"
return result.toString() ?: ""
}
// An excerpt from the standard library
fun print(message : String) { System.out?.print(message) }
fun println(message : String) { System.out?.println(message) }
fun StringBuilder.plusAssign(o : Any) { append(o) }
val <T> Array<T>.isEmpty : Boolean get() = size == 0