summaryrefslogtreecommitdiff
path: root/src/library/scala/Function0.scala
blob: 5f2141510a2496068043e7152e096e898bc85eb4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2002-2006, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |                                         **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */

// generated on Mon Nov 27 15:01:28 CET 2006 (with fancy comment)
// $Id$

package scala


/**
 * Function with 0 parameters. In the following example the definition of
 * <code>currentSeconds</code> is a shorthand for the anonymous class
 * definition <code>anonfun0</code>:
 * <pre>
 * <b>object</b> Main <b>extends</b> Application {
 *
 *   <b>val</b> currentSeconds = () => System.currentTimeMillis() / 1000L
 *
 *   <b>val</b> anonfun0 = <b>new</b> Function0[Long] {
 *     <b>def</b> apply(): Long = System.currentTimeMillis() / 1000L
 *   }
 *
 *   Console.println(currentSeconds())
 *   Console.println(anonfun0())
 * }</pre>
 */
trait Function0 [+R] extends AnyRef {
  def apply(): R
  override def toString() = "<function>"

}