summaryrefslogtreecommitdiff
path: root/sources/scala/Option.scala
diff options
context:
space:
mode:
authorMatthias Zenger <mzenger@gmail.com>2003-07-18 22:11:21 +0000
committerMatthias Zenger <mzenger@gmail.com>2003-07-18 22:11:21 +0000
commitc1bcad868c80dd4fabdb03af70539cb21ecb187f (patch)
tree86d07a11d322ce9ed438d68f403ac7e8a8229f83 /sources/scala/Option.scala
parent511713e0f473c8722c60d0efdfd934bc10281625 (diff)
downloadscala-c1bcad868c80dd4fabdb03af70539cb21ecb187f.tar.gz
scala-c1bcad868c80dd4fabdb03af70539cb21ecb187f.tar.bz2
scala-c1bcad868c80dd4fabdb03af70539cb21ecb187f.zip
Added some comments and removed inconsistencies.
Diffstat (limited to 'sources/scala/Option.scala')
-rw-r--r--sources/scala/Option.scala27
1 files changed, 20 insertions, 7 deletions
diff --git a/sources/scala/Option.scala b/sources/scala/Option.scala
index 3a37835bc5..0f373db10c 100644
--- a/sources/scala/Option.scala
+++ b/sources/scala/Option.scala
@@ -1,6 +1,23 @@
-package scala {
-
- trait Option[+a] {
+/* __ *\
+** ________ ___ / / ___ Scala API **
+** / __/ __// _ | / / / _ | (c) 2002-2003, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | **
+** /____/\___/_/ |_/____/_/ | | **
+** |/ **
+** $Id$
+\* */
+
+package scala;
+
+
+/** This class represents optional values. Instances of <code>Option</code>
+ * are either instances of case class <code>Some</code> or it is case
+ * object <code>None</code>.
+ *
+ * @author Martin Odersky
+ * @version 1.0, 16/07/2003
+ */
+trait Option[+a] {
def get: a = this match {
case None => error("None.get")
@@ -31,8 +48,4 @@ package scala {
case None => Predef.List()
case Some(x) => Predef.List(x)
}
-
- def print: Unit =
- System.out.println(this.toString())
- }
}