[nem-en] Delegate problem / cs2n
Marcin Machura
emmar at poczta.wp.pl
Thu Feb 1 19:36:47 CET 2007
Hi!
I have a problem with delegates in Nemerle. So I've created C# code with
delegate and convert it into Nemerle.
And it doesn't work :(
Errors:
delegate.n:9:10:9:24: error: expecting simple identifier instead of
`WriteLine (f ())'
delegate.n:18:4:20:3: error: expecting simple identifier instead of
`doit (fun [] () : _ 33)'
(source code below)
Best regards
Marcin Machura
/* delegate.cs file */
using System;
class Dwa
{
public delegate int Factory();
public void doit(Factory f)
{
Console.WriteLine(f());
}
}
public class Moja
{
public static void Main()
{
Dwa d = new Dwa();
d.doit(delegate()
{ return 33; }
);
}
}
/* delegate.n file, generated by cs2n */
using System;
class Dwa
{
public delegate Factory() : int;
public doit(mutable f : Factory) : void
{
Console.WriteLine(f());
}
}
public class Moja
{
public static Main() : void
{
mutable d = Dwa();
d.doit(fun()
{ 33; }
);
}
}
More information about the devel-en
mailing list