summaryrefslogtreecommitdiff
path: root/src/cldc-library
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2007-11-28 12:07:04 +0000
committermichelou <michelou@epfl.ch>2007-11-28 12:07:04 +0000
commit924c77e79b5f964bd57985f42e63f48adc96bed5 (patch)
tree448069e884c5fff1a82035b6633dbc81bb14b9ed /src/cldc-library
parentb8681839ed77fbd44f2660b0d3b540bdc0861e66 (diff)
downloadscala-924c77e79b5f964bd57985f42e63f48adc96bed5.tar.gz
scala-924c77e79b5f964bd57985f42e63f48adc96bed5.tar.bz2
scala-924c77e79b5f964bd57985f42e63f48adc96bed5.zip
removed FloatTag/DoubleTag (CLDC)
Diffstat (limited to 'src/cldc-library')
-rw-r--r--src/cldc-library/scala/runtime/ScalaRunTime.scala30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/cldc-library/scala/runtime/ScalaRunTime.scala b/src/cldc-library/scala/runtime/ScalaRunTime.scala
index f69524be52..8cabf9c623 100644
--- a/src/cldc-library/scala/runtime/ScalaRunTime.scala
+++ b/src/cldc-library/scala/runtime/ScalaRunTime.scala
@@ -24,13 +24,13 @@ object ScalaRunTime {
val CharTag = ".Char"
val IntTag = ".Int"
val LongTag = ".Long"
- val FloatTag = ".Float"
- val DoubleTag = ".Double"
val BooleanTag = ".Boolean"
- def isArray(x: AnyRef): Boolean = (x != null && x.getClass.isArray) || (x != null && x.isInstanceOf[BoxedArray])
+ def isArray(x: AnyRef): Boolean =
+ (x != null && x.getClass.isArray) || (x != null && x.isInstanceOf[BoxedArray])
+
def isValueTag(tag: String) = tag.charAt(0) == '.'
- //def isValueClass(clazz: Class) = clazz.isPrimitive()
+
def isValueClass(clazz: Class) = (clazz == classOf[Boolean]
|| clazz == classOf[Byte]
|| clazz == classOf[Short]
@@ -41,20 +41,20 @@ object ScalaRunTime {
def checkInitialized[T <: AnyRef](x: T): T =
if (x == null) throw new UninitializedError else x
- abstract class Try[a] {
- def Catch[b >: a](handler: PartialFunction[Throwable, b]): b
- def Finally(handler: Unit): a
+ abstract class Try[A] {
+ def Catch[B >: A](handler: PartialFunction[Throwable, B]): B
+ def Finally(handler: Unit): A
}
- def Try[a](block: => a): Try[a] = new Try[a] with Runnable {
- var result: a = _
+ def Try[A](block: => A): Try[A] = new Try[A] with Runnable {
+ var result: A = _
var exception: Throwable = ExceptionHandling.tryCatch(this)
- def run(): Unit = result = block
+ def run() { result = block }
- def Catch[b >: a](handler: PartialFunction[Throwable, b]): b =
+ def Catch[B >: A](handler: PartialFunction[Throwable, B]): B =
if (exception eq null)
- result.asInstanceOf[b]
+ result.asInstanceOf[B]
// !!! else if (exception is LocalReturn)
// !!! // ...
else if (handler isDefinedAt exception)
@@ -62,9 +62,9 @@ object ScalaRunTime {
else
throw exception
- def Finally(handler: Unit): a =
+ def Finally(handler: Unit): A =
if (exception eq null)
- result.asInstanceOf[a]
+ result.asInstanceOf[A]
else
throw exception
}
@@ -123,7 +123,7 @@ object ScalaRunTime {
//def checkDefined[T >: Null](x: T): T =
// if (x == null) throw new UndefinedException else x
- def Seq[a](xs: a*): Seq[a] = null // interpreted specially by new backend.
+ def Seq[A](xs: A*): Seq[A] = null // interpreted specially by new backend.
def arrayValue(x: BoxedArray, elemTag: String): AnyRef =
if (x eq null) null else x.unbox(elemTag)