If my understanding is right, you have problems with file order. In VS(actually F# integration) order of the files does matter. Means that you cannot not have your harry.fs after fred.fs. To change file order jsut open *.fsproj file with notepad and find following:

1
2
3
4
5
<ItemGroup>
    <Compile Include="harry.fs" />
    <Compile Include="fred.fs" />
</ItemGroup>

Ajust the order of the files from top to bottom.

By on 1/30/2009 5:55 AM ()

Thanks for that tip!

I've also stumbled across a kind of solution of the 'filename = module name' variety.... this lets me define and open a module from within the same project and I've got this working OK.

But...

I'm wondering also, however, how to reference an F# module from another project / DLL?

By on 1/30/2009 6:15 AM ()

Thanks for that tip! I've also stumbled across a kind of solution of the 'filename = module name' variety.... this lets me define and open a module from within the same project and I've got this working OK.

Yah, this is another feature, you also can get rid of the autogenerated module names by using namespaces.

But... I'm wondering also, however, how to reference an F# module from another project / DLL?

With regular "Add Reference..." menu. No magic here.

By on 1/30/2009 6:57 AM ()

See also

[link:lorgonblog.spaces.live.com]

[link:lorgonblog.spaces.live.com]

When I can find the time, I want to write another one about namespaces, filename-as-implicit-module, file order, etc.

By on 1/30/2009 9:10 AM ()

Thanks! It really is that simple.

I'm pretty sure I've seen

Module Blah =

as well as plain

Module Blah

in my travels. I realise that F# is a moving target and I'm going to see deprecated usages in books and blogs from time to time. Is this one of these cases?

By on 1/30/2009 8:40 PM ()

Nope; they're both allowed and mean different things. I think the one with the '=' is just defining a module nested in whatever outer construct you happen to be in whereas module-sans-equals is a way for the whole file to go in a module with a name other than the filename. And an alternative to both is to start a file with a namespace, in which case it's a set of namespace fragments. I don't even know it all offhand, which is why I need to experiment and read the spec and blog it. :) And there are still little holes in the language, like the inability to define a type in the global namespace.

By on 1/31/2009 12:29 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper