IEnumerator<T> extends the non-generic IEnumerator. This means there are two get_Current methods to implement, with different return types, which means you should implement the non-generic interface explicitly:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 

open System.Collections.Generic

let x = { new IEnumerator<int> 
            with get_Current() = 0 
          interface System.Collections.IEnumerator
            with get_Current() = box 0 
            and  Reset() = () 
            and  MoveNext() = true 
          interface System.IDisposable
            with Dispose() = () 
            };;

There are many examples in the implementation of the IEnumerable module (ienumerable.fs) in the distribution.

cheers,

don

By on 9/23/2006 5:54 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper