diff options
author | Martin Odersky <odersky@gmail.com> | 2006-09-01 13:37:49 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2006-09-01 13:37:49 +0000 |
commit | def54abfbdcd86224920b951e8b8990bcbcfc04c (patch) | |
tree | c9c2b26963b2a028fc676dd842a658b9675c63c1 /src/library | |
parent | 3a4a6a3b66a98cc18cda27b0d008ee6aba425250 (diff) | |
download | scala-def54abfbdcd86224920b951e8b8990bcbcfc04c.tar.gz scala-def54abfbdcd86224920b951e8b8990bcbcfc04c.tar.bz2 scala-def54abfbdcd86224920b951e8b8990bcbcfc04c.zip |
1. Added by name functions and nby-name implicits
2. Clarified code in Erasure
Diffstat (limited to 'src/library')
-rwxr-xr-x | src/library/scala/ByNameFunction.scala | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/library/scala/ByNameFunction.scala b/src/library/scala/ByNameFunction.scala new file mode 100755 index 0000000000..0773c90863 --- /dev/null +++ b/src/library/scala/ByNameFunction.scala @@ -0,0 +1,26 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $Id: PartialFunction.scala 7931 2006-06-20 16:34:51 +0000 (Tue, 20 Jun 2006) odersky $ + + +package scala; + + +/** A partial function of type <code>PartialFunction[A, B]</code> is a + * unary function where the domain does not include all values of type + * <code>A</code>. The function <code>isDefinedAt</code> allows to + * test dynamically, if a value is in the domain of the function. + * + * @author Martin Odersky + * @version 1.0, 16/07/2003 + */ +trait ByNameFunction[-A, +B] extends AnyRef { + def apply(x: => A): B +} + |