refactored std.* package to be kotlin.*. Due to KT-1381 I had to move the functions from kotlin.test into the stdlib for now (I made them not depend on JUnit for now)

This commit is contained in:
James Strachan
2012-03-03 12:11:06 +00:00
parent 4a53e468fe
commit eb3aac9acb
162 changed files with 454 additions and 324 deletions
@@ -1,7 +1,7 @@
namespace change
import java.math.BigDecimal
import std.io.*
import kotlin.io.*
fun main(args : Array<String>) {
// Easy to make BigDecimals user-friendly
@@ -1,6 +1,6 @@
namespace long.division
import std.io.*
import kotlin.io.*
fun main(args : Array<String>) {
// Problematic case does not compile
@@ -1,6 +1,6 @@
namespace long.division.solution
import std.io.*
import kotlin.io.*
fun main(args : Array<String>) {
val MICROS_PER_DAY : Long = 24.toLong() * 60 * 60 * 1000 * 1000;
@@ -1,6 +1,6 @@
namespace elementary
import std.io.*
import kotlin.io.*
fun main(args : Array<String>) {
// Problematic case does not compile
@@ -1,6 +1,6 @@
namespace multicast
import std.io.*
import kotlin.io.*
fun main(args : Array<String>) {
println(-1.toByte().toChar().toInt())
@@ -1,6 +1,6 @@
namespace cleverswap
import std.io.*
import kotlin.io.*
fun main(args : Array<String>) {
var x = 1
@@ -1,6 +1,6 @@
namespace dos.equis
import std.io.*
import kotlin.io.*
fun main(args : Array<String>) {
// Problematic case does not compile
@@ -1,6 +1,6 @@
namespace last.laugh
import std.io.*
import kotlin.io.*
fun main(args : Array<String>) {
print("H" + "a")
@@ -1,7 +1,7 @@
namespace animal.farm
import std.io.*
import std.*
import kotlin.io.*
import kotlin.*
fun main(args : Array<String>) {
val pig = "length: 10";
@@ -1,7 +1,7 @@
namespace escape.rout
import std.io.*
import std.*
import kotlin.io.*
import kotlin.*
fun main(args : Array<String>) {
// \u0022 is the Unicode escape for double quote (")
@@ -1,7 +1,7 @@
namespace hello.whirled
import std.io.*
import std.*
import kotlin.io.*
import kotlin.*
/**
* Generated by the IBM IDL-to-Java compiler, version 1.0
@@ -1,7 +1,7 @@
namespace line.printer
import std.io.*
import std.*
import kotlin.io.*
import kotlin.*
fun main(args : Array<String>) {
// Note: \u000A is Unicode representation of linefeed (LF)
@@ -1,8 +1,8 @@
namespace whats.my.`class`
import std.io.*
import std.string.*
import std.jutils.*
import kotlin.io.*
import kotlin.string.*
import kotlin.jutils.*
class Me() {
fun main() {
@@ -1,8 +1,8 @@
namespace whats.my.`class`.take2
import std.io.*
import std.string.*
import std.jutils.*
import kotlin.io.*
import kotlin.string.*
import kotlin.jutils.*
import java.io.File;
class MeToo() {
@@ -1,6 +1,6 @@
namespace no.pain.no.gain
import std.io.*
import kotlin.io.*
val rnd = java.util.Random();
@@ -1,6 +1,6 @@
namespace big.delight.in.every.byte
import std.io.*
import kotlin.io.*
fun main(args : Array<String>) {
// for (b : Byte in Byte.MIN_VALUE..Byte.MAX_VALUE) {
@@ -1,6 +1,6 @@
namespace `in`.the.loop
import std.io.*
import kotlin.io.*
val END = Integer.MAX_VALUE
val START = END - 100
@@ -1,6 +1,6 @@
namespace ghost.of.looper
import std.io.*
import kotlin.io.*
fun main(args : Array<String>) {
var i : Short = -1.toShort()
@@ -1,6 +1,6 @@
namespace curse.of.loooper // BUG!!!
import std.io.*
import kotlin.io.*
class Curse<T : Comparable<T>>() {
fun curse(i : T, j : T) {
@@ -1,6 +1,6 @@
namespace down.`for`.the.count
import std.io.*
import kotlin.io.*
fun main(args : Array<String>) {
// Problematic code does not compile
@@ -1,6 +1,6 @@
namespace indecision
import std.io.*
import kotlin.io.*
fun main(args : Array<String>) {
println(decision())
@@ -1,6 +1,6 @@
namespace unwelcome.guest
import std.io.*
import kotlin.io.*
val GUEST_USER_ID = -1
val USER_ID =
@@ -1,6 +1,6 @@
namespace the.reluctant.constructor
import std.io.*
import kotlin.io.*
public class Reluctant() {
val internalInstance = Reluctant() // Recursion is obvious
@@ -1,7 +1,7 @@
namespace thrown.`for`.a.looop // BUG
import std.io.*
import std.*
import kotlin.io.*
import kotlin.*
fun iarr(vararg a : Int) = a // due to a BUG
@@ -1,7 +1,7 @@
namespace well.dog.my.cats
import std.io.*
import std.*
import kotlin.io.*
import kotlin.*
open class Counter {
class object {
@@ -1,7 +1,7 @@
namespace all.i.get.`is`.static
import std.io.*
import std.*
import kotlin.io.*
import kotlin.*
open class Dog() {
class object {
@@ -1,7 +1,7 @@
namespace `do`.your.thing
import std.io.*
import std.*
import kotlin.io.*
import kotlin.*
import _06_classy._53_Do_Your_Thing.Thing
class MyThing(val arg : Int) : Thing(arg) {
@@ -1,7 +1,7 @@
namespace `null`.and.void
import std.io.*
import std.*
import kotlin.io.*
import kotlin.*
class Null() {
class object {
@@ -1,7 +1,7 @@
namespace creationism
import std.io.*
import std.*
import kotlin.io.*
import kotlin.*
class Creature() {
class object {
@@ -1,7 +1,7 @@
namespace big.problem
import std.io.*
import std.*
import kotlin.io.*
import kotlin.*
import java.math.BigInteger
fun main(args : Array<String>) {
@@ -1,7 +1,7 @@
namespace whats.the.difference
import std.io.*
import std.*
import kotlin.io.*
import kotlin.*
import java.util.*
fun iarray(vararg a : Int) = a // BUG