>>20
Yeah, I don't think it's possible. Anyway, I figured out an alternative solution..
The problem was that there is this class that gets input from two sources and puts it together, one source sets up data, other requests it. As some data can be quite heavy and possibly never requested it's not a good idea to calculate it upfront. So, the idea was to, besides other data, set up also functions and later if required respond with what they return, that didn't work out so well. Alternative solution:
class Test
public static m1 () : IEnumerable
WriteLine ("HI2U FROM m1")
for (mutable i = 0; i <= 3; i++)
yield i.ToString ()
public static Main () : void
def a = ArrayList ()
a.Add ("foo")
a.Add (42)
a.Add (m1 ())
WriteLine ("BEGIN MATCH")
def loop (i = 0) : void
if (a.Count == i)
WriteLine ("END MATCH")
else
match (a[i] : object)
| _ is string =>
WriteLine ("string GET")
| _ is int =>
WriteLine ("int GET")
| _ is IEnumerable =>
WriteLine ("IEnumerable GET")
//foreach (z in a[i] :> IEnumerable)
//WriteLine (z);
| _ =>
WriteLine ("DUNNO LOL")
loop (i + 1)
loop ()
When you run this notice that there isn't "HI2U FROM m1", although you do m1 (), only when you uncomment foreach you see it.