[nem-en] Delegate problem / cs2n

Kamil Skalski kamil.skalski at gmail.com
Thu Feb 1 19:59:23 CET 2007


Works fine for me...


2007/2/1, Marcin Machura <emmar at poczta.wp.pl>:
> 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)'
>

This looks like a problem with loading Nemerle.Macros.dll. Are you
sure you don't this this library duplicated in several places
(especially in current directory)


> (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; }
>         );
>     }
> }
>
>
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>


-- 
Kamil Skalski
http://nazgul.omega.pl



More information about the devel-en mailing list