diff options
Diffstat (limited to 'mcs/class/Mono.C5/UserGuideExamples/ThisFun.cs')
-rw-r--r-- | mcs/class/Mono.C5/UserGuideExamples/ThisFun.cs | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/mcs/class/Mono.C5/UserGuideExamples/ThisFun.cs b/mcs/class/Mono.C5/UserGuideExamples/ThisFun.cs deleted file mode 100644 index 1fd29f1c122..00000000000 --- a/mcs/class/Mono.C5/UserGuideExamples/ThisFun.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Experiment: implicit conversion of indexer to function
-// sestoft@dina.kvl.dk * 2005-11-08
-
-using System;
-using C5;
-
-class MyFunTest {
- public static void Main(String[] args) {
- FooBar fb = new FooBar();
- IList<int> list = new LinkedList<int>();
- list.AddAll(new int[] { 2, 3, 5, 7, 11 });
- list.Map<double>(fb).Apply(Console.WriteLine);
- list.Apply(fb);
- }
-}
-
-class FooBar {
- public double this[int x] {
- get {
- Console.WriteLine(x);
- return x + 1.5;
- }
- }
-
- public Fun<int,double> Fun {
- get {
- return delegate(int x) { return this[x]; };
- }
- }
-
- public Act<int> Act {
- get {
- return delegate(int x) { double junk = this[x]; };
- }
- }
-
- public static implicit operator Fun<int,double>(FooBar fb) {
- return delegate(int x) { return fb[x]; };
- }
-
- public static implicit operator Act<int>(FooBar fb) {
- return delegate(int x) { double junk = fb[x]; };
- }
-}
-
-
|