<?xml version="1.0" encoding="utf-8"?><!-- generator="wordpress/1.5.1.3" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: F# - The thing with the namespaces</title>
	<link>http://www.sturmnet.org/blog/archives/2008/03/18/f-the-thing-with-the-namespaces/</link>
	<description>General musings and programming stuff</description>
	<pubDate>Thu, 07 Aug 2008 21:28:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=1.5.1.3</generator>

	<item>
		<title>by: Kal</title>
		<link>http://www.sturmnet.org/blog/archives/2008/03/18/f-the-thing-with-the-namespaces/#comment-185300</link>
		<pubDate>Mon, 14 Jul 2008 17:44:15 +0000</pubDate>
		<guid>http://www.sturmnet.org/blog/archives/2008/03/18/f-the-thing-with-the-namespaces/#comment-185300</guid>
					<description>Alright, I was able to figure out the problem a few minutes after posting.  This was just a case of me not completely reading my project's Properties page where it states that files are built in the order they are listed in the solution explorer.  So I really had no namespace problem, just a build order problem fixed by editing the project file by hand.</description>
		<content:encoded><![CDATA[	<p>Alright, I was able to figure out the problem a few minutes after posting.  This was just a case of me not completely reading my project&#8217;s Properties page where it states that files are built in the order they are listed in the solution explorer.  So I really had no namespace problem, just a build order problem fixed by editing the project file by hand.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Kal</title>
		<link>http://www.sturmnet.org/blog/archives/2008/03/18/f-the-thing-with-the-namespaces/#comment-185187</link>
		<pubDate>Mon, 14 Jul 2008 14:50:51 +0000</pubDate>
		<guid>http://www.sturmnet.org/blog/archives/2008/03/18/f-the-thing-with-the-namespaces/#comment-185187</guid>
					<description>I may be late to the party here, but I am going through the exact same growing pains: breaking up my first F# project.  I don't even appear to be able to pull off the trick you mention.

First I had 'namespace Company.Product' which defines my window class and was referenced by main.fs.  No problems.

When splitting off my graphics from the window into 'namespace Company.OpenGL' I lose ANY way to reference this new namespace from the window file (the other namespace).  Out of only three files, file2 can never seem to reference file3 no matter how I swap or rename namespaces.

The only way I've been able to compile since then is by moving my application loop (only thing in file one, main.fs) back to mainwindow.fs, removing any namespace declaration there which then allows me to reference the OpenGL ns.  Worst of all, it feels like VS2008 really needs a close solution/open solution when changing these namespaces before it properly recognizes them.  Finally, the code works in FSI as well, but only, I think, because I am able to use &amp;#34;#load &amp;#34;Opengl.fs&amp;#34;&amp;#34;.

&amp;#60;b&amp;#62;So my questions are:&amp;#60;/b&amp;#62; do F# namespaces work differently than C# ones?  Why can't two files in different parts of the same NS reference each other (X.Y can use 'open X.Z' and call Z's members)?

I can't specifically remember rules for C# NSes because they are so easy to use.  For instance, in the example above, I never declared a Company namespace.  So Oliver, when I try your trick in Company.Product, I get a &amp;#34;The namespace of module 'Company' is not defined&amp;#34; when I use &amp;#34;open Company.Product&amp;#34;.  This is error is technically true but changes the NSes to fix it doesn't solve the problem.  In C#, for files in the same project, I'm pretty sure I can declare any NS and reference it with 'using' from any other file in that project without fail.</description>
		<content:encoded><![CDATA[	<p>I may be late to the party here, but I am going through the exact same growing pains: breaking up my first F# project.  I don&#8217;t even appear to be able to pull off the trick you mention.</p>
	<p>First I had &#8216;namespace Company.Product&#8217; which defines my window class and was referenced by main.fs.  No problems.</p>
	<p>When splitting off my graphics from the window into &#8216;namespace Company.OpenGL&#8217; I lose ANY way to reference this new namespace from the window file (the other namespace).  Out of only three files, file2 can never seem to reference file3 no matter how I swap or rename namespaces.</p>
	<p>The only way I&#8217;ve been able to compile since then is by moving my application loop (only thing in file one, main.fs) back to mainwindow.fs, removing any namespace declaration there which then allows me to reference the OpenGL ns.  Worst of all, it feels like VS2008 really needs a close solution/open solution when changing these namespaces before it properly recognizes them.  Finally, the code works in FSI as well, but only, I think, because I am able to use &quot;#load &quot;Opengl.fs&quot;&quot;.</p>
	<p>&lt;b&gt;So my questions are:&lt;/b&gt; do F# namespaces work differently than C# ones?  Why can&#8217;t two files in different parts of the same NS reference each other (X.Y can use &#8216;open X.Z&#8217; and call Z&#8217;s members)?</p>
	<p>I can&#8217;t specifically remember rules for C# NSes because they are so easy to use.  For instance, in the example above, I never declared a Company namespace.  So Oliver, when I try your trick in Company.Product, I get a &quot;The namespace of module &#8216;Company&#8217; is not defined&quot; when I use &quot;open Company.Product&quot;.  This is error is technically true but changes the NSes to fix it doesn&#8217;t solve the problem.  In C#, for files in the same project, I&#8217;m pretty sure I can declare any NS and reference it with &#8216;using&#8217; from any other file in that project without fail.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Marc</title>
		<link>http://www.sturmnet.org/blog/archives/2008/03/18/f-the-thing-with-the-namespaces/#comment-143611</link>
		<pubDate>Thu, 20 Mar 2008 14:58:02 +0000</pubDate>
		<guid>http://www.sturmnet.org/blog/archives/2008/03/18/f-the-thing-with-the-namespaces/#comment-143611</guid>
					<description>Here a short article on F# (for those for whom F# is totaly new):
&amp;#60;a href=&amp;#34;http://msdn2.microsoft.com/en-us/magazine/cc164244.aspx&amp;#34; title=&amp;#34;F# Primer: Use Functional Programming Techniques in the .NET Framework&amp;#34;&amp;#62;</description>
		<content:encoded><![CDATA[	<p>Here a short article on F# (for those for whom F# is totaly new):<br />
&lt;a href=&quot;http://msdn2.microsoft.com/en-us/magazine/cc164244.aspx&quot; title=&quot;F# Primer: Use Functional Programming Techniques in the .NET Framework&quot;&gt;
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Oliver Sturm</title>
		<link>http://www.sturmnet.org/blog/archives/2008/03/18/f-the-thing-with-the-namespaces/#comment-143372</link>
		<pubDate>Wed, 19 Mar 2008 14:18:51 +0000</pubDate>
		<guid>http://www.sturmnet.org/blog/archives/2008/03/18/f-the-thing-with-the-namespaces/#comment-143372</guid>
					<description>Interesting question... perhaps not, since XPO is a library and an important design criteria is that others must be able to use it easily. So unless my potential target group uses F# as well, they might not be able to benefit from things I have done, and in some cases usability might be decreased. 

That said, &amp;#34;does it make sense&amp;#34; is a bit of a weird question. I believe that F# is generally a more powerful language than C#, and so yes, it makes sense to use the most powerful language for most tasks. Would I start a new project in it today? Yes, I probably would. Would I go back and rewrite something that exists, for a perceived benefit? In most cases, probably not, since the benefit wouldn't justify that. But I'd probably try to use F# for additions to an existing core - .NET makes this easy. Whether or not these approaches are actually considered today, in 2008, in many development teams, depends on yet another set of conditions...

I've probably not looked into all the issues that might come up, but at least there'd be some questions to answer before one could consider using F# for a general purpose library that needs to be reused from other languages. In this situation, more often than one we find ourselves using the least common denominator only.</description>
		<content:encoded><![CDATA[	<p>Interesting question&#8230; perhaps not, since XPO is a library and an important design criteria is that others must be able to use it easily. So unless my potential target group uses F# as well, they might not be able to benefit from things I have done, and in some cases usability might be decreased. </p>
	<p>That said, &quot;does it make sense&quot; is a bit of a weird question. I believe that F# is generally a more powerful language than C#, and so yes, it makes sense to use the most powerful language for most tasks. Would I start a new project in it today? Yes, I probably would. Would I go back and rewrite something that exists, for a perceived benefit? In most cases, probably not, since the benefit wouldn&#8217;t justify that. But I&#8217;d probably try to use F# for additions to an existing core - .NET makes this easy. Whether or not these approaches are actually considered today, in 2008, in many development teams, depends on yet another set of conditions&#8230;</p>
	<p>I&#8217;ve probably not looked into all the issues that might come up, but at least there&#8217;d be some questions to answer before one could consider using F# for a general purpose library that needs to be reused from other languages. In this situation, more often than one we find ourselves using the least common denominator only.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Marc</title>
		<link>http://www.sturmnet.org/blog/archives/2008/03/18/f-the-thing-with-the-namespaces/#comment-143366</link>
		<pubDate>Wed, 19 Mar 2008 13:15:58 +0000</pubDate>
		<guid>http://www.sturmnet.org/blog/archives/2008/03/18/f-the-thing-with-the-namespaces/#comment-143366</guid>
					<description>Seriously, if for example you had to start XPO over, would it make sense to develop it in F# ?</description>
		<content:encoded><![CDATA[	<p>Seriously, if for example you had to start XPO over, would it make sense to develop it in F# ?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Oliver Sturm</title>
		<link>http://www.sturmnet.org/blog/archives/2008/03/18/f-the-thing-with-the-namespaces/#comment-143349</link>
		<pubDate>Wed, 19 Mar 2008 11:52:54 +0000</pubDate>
		<guid>http://www.sturmnet.org/blog/archives/2008/03/18/f-the-thing-with-the-namespaces/#comment-143349</guid>
					<description>Hi Marc - no, not specifically. It's a great language, and I'm almost sure I like it better than C#.</description>
		<content:encoded><![CDATA[	<p>Hi Marc - no, not specifically. It&#8217;s a great language, and I&#8217;m almost sure I like it better than C#.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Anonymous</title>
		<link>http://www.sturmnet.org/blog/archives/2008/03/18/f-the-thing-with-the-namespaces/#comment-143348</link>
		<pubDate>Wed, 19 Mar 2008 11:49:49 +0000</pubDate>
		<guid>http://www.sturmnet.org/blog/archives/2008/03/18/f-the-thing-with-the-namespaces/#comment-143348</guid>
					<description>Hi Oliver,

Out of curiosity, what got you interested into F# ?
Is it for XPO / XAF ?

Regards,

Marc</description>
		<content:encoded><![CDATA[	<p>Hi Oliver,</p>
	<p>Out of curiosity, what got you interested into F# ?<br />
Is it for XPO / XAF ?</p>
	<p>Regards,</p>
	<p>Marc
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
