[nem-en] yiedl & Nemerle.Collection.Enumerable
Marcin Machura
emmar at poczta.wp.pl
Tue Jan 30 18:13:42 CET 2007
Why yield doesn't go with Nemerle.Collections.IEnumerable?
When I change using to S.C.Generic everything is fine,...
I am trying using Nemerle.Collections but it doesn't work :(
using System
using Nemerle.Collections
//using System.Collections.Generic
class X
public gen(n : int) : IEnumerable[int]
for(mutable i = 0; i < n; i++)
yield i * 10
def x = X()
foreach(n in x.gen(10))
Console.WriteLine(n.ToString())
Error message:
yield used in a `gen' function, which is returning
Nemerle.Collections.IEnumerable[int] (it should be
System.Collections.Generic.IEnumerator[T] or
System.Collections.Generic.IEnumerable[T])
confused by earlier errors bailing out
Best regards
Marcin Machura
More information about the devel-en
mailing list