¿Cómo usar el objeto C # de F #?
Tengo el siguiente código C #.
namespace MyMath {
public class Arith {
public Arith() {}
public int Add(int x, int y) {
return x + y;
}
}
}
Y se me ocurrió el código F # llamado testcs.fs para usar este objeto.
open MyMath.Arith
let x = Add(10,20)
Cuando ejecuto el siguiente comando
fsc -r:MyMath.dll testcs.fs
Recibí este mensaje de error.
/Users/smcho/Desktop/cs/namespace/testcs.fs(1,13): error FS0039: The namespace 'Arith' is not defined /Users/smcho/Desktop/cs/namespace/testcs.fs(3,9): error FS0039: The value or constructor 'Add' is not defined
¿Qué puede estar mal? Usé mono para el entorno .NET.