| Changes to /trunk/PluralTestsAndExamples/src/edu/cmu/cs/plural/util/Lambda2.java |
r0 vs. r49
Edit
|
r49
|
| /trunk/PluralTestsAndExamples/src/edu/cmu/cs/plural/util/Lambda2.java | /trunk/PluralTestsAndExamples/src/edu/cmu/cs/plural/util/Lambda2.java r49 | ||
| 1 | /** | ||
|---|---|---|---|
| 2 | * Copyright (C) 2007, 2008 Carnegie Mellon University and others. | ||
| 3 | * | ||
| 4 | * This file is part of Plural. | ||
| 5 | * | ||
| 6 | * Plural is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * Plural is distributed in the hope that it will be useful, but | ||
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | * General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with Plural; if not, see <http://www.gnu.org/licenses>. | ||
| 17 | * | ||
| 18 | * Linking Plural statically or dynamically with other modules is | ||
| 19 | * making a combined work based on Plural. Thus, the terms and | ||
| 20 | * conditions of the GNU General Public License cover the whole | ||
| 21 | * combination. | ||
| 22 | * | ||
| 23 | * In addition, as a special exception, the copyright holders of Plural | ||
| 24 | * give you permission to combine Plural with free software programs or | ||
| 25 | * libraries that are released under the GNU LGPL and with code | ||
| 26 | * included in the standard release of Eclipse under the Eclipse Public | ||
| 27 | * License (or modified versions of such code, with unchanged license). | ||
| 28 | * You may copy and distribute such a system following the terms of the | ||
| 29 | * GNU GPL for Plural and the licenses of the other code concerned. | ||
| 30 | * | ||
| 31 | * Note that people who make modified versions of Plural are not | ||
| 32 | * obligated to grant this special exception for their modified | ||
| 33 | * versions; it is their choice whether to do so. The GNU General | ||
| 34 | * Public License gives permission to release a modified version | ||
| 35 | * without this exception; this exception also makes it possible to | ||
| 36 | * release a modified version which carries forward this exception. | ||
| 37 | */ | ||
| 38 | package edu.cmu.cs.plural.util; | ||
| 39 | |||
| 40 | import edu.cmu.cs.plural.annot.Perm; | ||
| 41 | import edu.cmu.cs.plural.annot.Pure; | ||
| 42 | |||
| 43 | /** | ||
| 44 | * A 'lambda,' or first-class function, that takes two arguments and | ||
| 45 | * returns one argument. | ||
| 46 | * | ||
| 47 | * @author Nels E. Beckman | ||
| 48 | * @since Sep 9, 2008 | ||
| 49 | * | ||
| 50 | * @param <I1> The type of the first argument. | ||
| 51 | * @param <I2> The type of the second argument. | ||
| 52 | * @param <O> The type of the output. | ||
| 53 | */ | ||
| 54 | public interface Lambda2<I1, I2, O> { | ||
| 55 | |||
| 56 | @Perm(requires="pure(this) * immutable(#0) * immutable(#1)", | ||
| 57 | ensures="pure(this) * immutable(result)") | ||
| 58 | public O call(@Pure(returned=false) I1 i1, @Pure(returned=false) I2 i2); | ||
| 59 | |||
| 60 | } | ||