I have this class in C #:
using System.Collections.Generic;
namespace StrassGlassLib
{
public class Mesh
{
private List<Model.Node> _ns;
private List<Model.Plate> _ps;
public Mesh()
{
_ns = new List<Model.Node>();
_ps = new List<Model.Plate>();
}
public List<Model.Node> Nodes => _ns;
public List<Model.Plate> Plates => _ps;
public void AddNode(Model.Node n)
{
_ns.Add(n);
}
public void AddPlate(Model.Plate p)
{
_ps.Add(p);
}
public static Mesh CreatePlanarMesh()
{
Mesh m = new Mesh();
for (int y = 0; y < 2; y += 1)
{
for (int x = 0; x < 4; x += 1)
{
m.AddNode(new Model.Node(0, x, y, 0.0));
}
}
return m;
}
}
}
I am trying to call from F # to find out how to do a test with this language, but:
namespace StraussGlassTest
open System
module MeshTesting =
open StrassGlassLib
let m = Mesh.CreatePlanarMesh()
Problems:
- I have error FS0039: the namespace or module "Mesh" is not defined.
- There is no error on the console, the code looks good
- If I try to access the Nodes property, I get error FS0039: field, constructor or member 'Nodes' not defined
I guess I miss more than something about how F # works, do you have any tips?
source
share