<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Tuples rock my world</title>
	<atom:link href="http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/feed/" rel="self" type="application/rss+xml" />
	<link>http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/</link>
	<description>...and again, and again, and once more</description>
	<pubDate>Mon, 06 Oct 2008 21:17:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: David</title>
		<link>http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/#comment-37</link>
		<dc:creator>David</dc:creator>
		<pubDate>Fri, 09 May 2008 21:20:16 +0000</pubDate>
		<guid isPermaLink="false">http://tryingthisagain.com/?p=30#comment-37</guid>
		<description>helium&#62; Pretty cool. Even cooler would be some kind of active pattern.

Don't know if I misunderstand you, but you can simply do this in F#:

match Int32.TryParse(xxx), Int32.TryParse(yyy) with
  &#124; (true, foo), (true, bar) -&#62; (* something *)
  &#124; _ -&#62; (* otherwise *)

Anyone still not agreeing with Kurt?

Btw, a real F#-ish TryParse would return an option value, with which it could look like this:

match Int32.TryParse xxx, Int32.TryParse yyy with
  &#124; Some foo, Some bar -&#62; (* something *)
  &#124; _ -&#62; (* otherwise *)</description>
		<content:encoded><![CDATA[<p>helium&gt; Pretty cool. Even cooler would be some kind of active pattern.</p>
<p>Don&#8217;t know if I misunderstand you, but you can simply do this in F#:</p>
<p>match Int32.TryParse(xxx), Int32.TryParse(yyy) with<br />
  | (true, foo), (true, bar) -&gt; (* something *)<br />
  | _ -&gt; (* otherwise *)</p>
<p>Anyone still not agreeing with Kurt?</p>
<p>Btw, a real F#-ish TryParse would return an option value, with which it could look like this:</p>
<p>match Int32.TryParse xxx, Int32.TryParse yyy with<br />
  | Some foo, Some bar -&gt; (* something *)<br />
  | _ -&gt; (* otherwise *)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Building an F# powered indexing system &#60; Trying This Again</title>
		<link>http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/#comment-34</link>
		<dc:creator>Building an F# powered indexing system &#60; Trying This Again</dc:creator>
		<pubDate>Wed, 07 May 2008 22:24:52 +0000</pubDate>
		<guid isPermaLink="false">http://tryingthisagain.com/?p=30#comment-34</guid>
		<description>[...] The SchemaField type needs two basic pieces of information, a label and a set of options. I don't know about you, but when I read "two pieces of information", I think tuple: [...]</description>
		<content:encoded><![CDATA[<p>[...] The SchemaField type needs two basic pieces of information, a label and a set of options. I don&#8217;t know about you, but when I read &#8220;two pieces of information&#8221;, I think tuple: [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: helium</title>
		<link>http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/#comment-35</link>
		<dc:creator>helium</dc:creator>
		<pubDate>Mon, 05 May 2008 13:24:11 +0000</pubDate>
		<guid isPermaLink="false">http://tryingthisagain.com/?p=30#comment-35</guid>
		<description>let first, foo = Int32.TryParse(xxx);
let second, bar = Int32.TryParse(yyy);


if first &#38;&#38; second then (* dothomething with first and second *) else (* default behaviour *)


Pretty cool. Even cooler would be some kind of active pattern.

match (xxx, yyy) with
&#124; (parse(first), parse(second)) -&#62; (* dothomething with first and second *)
&#124; _ -&#62; (* default behaviour *)</description>
		<content:encoded><![CDATA[<p>let first, foo = Int32.TryParse(xxx);<br />
let second, bar = Int32.TryParse(yyy);</p>
<p>if first &amp;&amp; second then (* dothomething with first and second *) else (* default behaviour *)</p>
<p>Pretty cool. Even cooler would be some kind of active pattern.</p>
<p>match (xxx, yyy) with<br />
| (parse(first), parse(second)) -&gt; (* dothomething with first and second *)<br />
| _ -&gt; (* default behaviour *)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Klaus</title>
		<link>http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/#comment-36</link>
		<dc:creator>Klaus</dc:creator>
		<pubDate>Fri, 18 Apr 2008 06:53:43 +0000</pubDate>
		<guid isPermaLink="false">http://tryingthisagain.com/?p=30#comment-36</guid>
		<description>I have made som very basic stuff for retreiving nullable types from TryParse:
http://www.khebbie.dk/post/2008/04/Nullable-TryParse.aspx</description>
		<content:encoded><![CDATA[<p>I have made som very basic stuff for retreiving nullable types from TryParse:<br />
<a href="http://www.khebbie.dk/post/2008/04/Nullable-TryParse.aspx" rel="nofollow">http://www.khebbie.dk/post/2008/04/Nullable-TryParse.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: C# vs F#: some parallel refactoring (and generalization) &#60; Trying This Again</title>
		<link>http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/#comment-22</link>
		<dc:creator>C# vs F#: some parallel refactoring (and generalization) &#60; Trying This Again</dc:creator>
		<pubDate>Wed, 16 Apr 2008 19:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://tryingthisagain.com/?p=30#comment-22</guid>
		<description>[...] shortly after adding the more in depth examples in my last post, I started playing around with the TryParse method in C# to see how "nice" I could make the example [...]</description>
		<content:encoded><![CDATA[<p>[...] shortly after adding the more in depth examples in my last post, I started playing around with the TryParse method in C# to see how &#8220;nice&#8221; I could make the example [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: daniel</title>
		<link>http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/#comment-26</link>
		<dc:creator>daniel</dc:creator>
		<pubDate>Wed, 16 Apr 2008 18:37:33 +0000</pubDate>
		<guid isPermaLink="false">http://tryingthisagain.com/?p=30#comment-26</guid>
		<description>I was just using Nullable as an example of returning a class instead of using an out parameter.

My point is you _can_ have "tupley" =) code in C#, it's just called a "return type".  In the case of the dictionary example:

var result = myDictionary.TryGetValue(key);
if (result.IsValidKey)
{
...result.Value
}
Where "TryGetValue" is an extension method that returns a custom type.

Granted, you don't get the language-baked feature to automatically do this, but with a few good extension methods, you wouldn't miss it =)</description>
		<content:encoded><![CDATA[<p>I was just using Nullable as an example of returning a class instead of using an out parameter.</p>
<p>My point is you _can_ have &#8220;tupley&#8221; =) code in C#, it&#8217;s just called a &#8220;return type&#8221;.  In the case of the dictionary example:</p>
<p>var result = myDictionary.TryGetValue(key);<br />
if (result.IsValidKey)<br />
{<br />
&#8230;result.Value<br />
}<br />
Where &#8220;TryGetValue&#8221; is an extension method that returns a custom type.</p>
<p>Granted, you don&#8217;t get the language-baked feature to automatically do this, but with a few good extension methods, you wouldn&#8217;t miss it =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Garry</title>
		<link>http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/#comment-28</link>
		<dc:creator>Garry</dc:creator>
		<pubDate>Wed, 16 Apr 2008 18:26:36 +0000</pubDate>
		<guid isPermaLink="false">http://tryingthisagain.com/?p=30#comment-28</guid>
		<description>Tuples rock!

However, it seems, in this case, that it would make more sense to have a bool Int32.CanParse(string value) method.

And, move the TryParse methods to a special System.ICryAboutPerformance namespace.

Just a thought.</description>
		<content:encoded><![CDATA[<p>Tuples rock!</p>
<p>However, it seems, in this case, that it would make more sense to have a bool Int32.CanParse(string value) method.</p>
<p>And, move the TryParse methods to a special System.ICryAboutPerformance namespace.</p>
<p>Just a thought.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin</title>
		<link>http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/#comment-27</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Wed, 16 Apr 2008 18:16:45 +0000</pubDate>
		<guid isPermaLink="false">http://tryingthisagain.com/?p=30#comment-27</guid>
		<description>Kurt,

It may be better to say what I am thinking. I was not aware of tuple's either and F# does seem to have an elegant way of handling multiple return values.</description>
		<content:encoded><![CDATA[<p>Kurt,</p>
<p>It may be better to say what I am thinking. I was not aware of tuple&#8217;s either and F# does seem to have an elegant way of handling multiple return values.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kurt</title>
		<link>http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/#comment-29</link>
		<dc:creator>Kurt</dc:creator>
		<pubDate>Wed, 16 Apr 2008 17:25:00 +0000</pubDate>
		<guid isPermaLink="false">http://tryingthisagain.com/?p=30#comment-29</guid>
		<description>Jurgen: Have a look at the additional examples I provided.  I'm being a bit hyperbolic, but useless variable declarations qualify as bloat as far as I'm concerned. :)</description>
		<content:encoded><![CDATA[<p>Jurgen: Have a look at the additional examples I provided.  I&#8217;m being a bit hyperbolic, but useless variable declarations qualify as bloat as far as I&#8217;m concerned. <img src='http://tryingthisagain.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jurgen</title>
		<link>http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/#comment-30</link>
		<dc:creator>Jurgen</dc:creator>
		<pubDate>Wed, 16 Apr 2008 16:49:20 +0000</pubDate>
		<guid isPermaLink="false">http://tryingthisagain.com/?p=30#comment-30</guid>
		<description>Maybe I miss your point, but where do you see "a ton of useless supporting code" in this :

string raw = "1234";
int val; /* No need to initialize an out parameter */
bool success = int.TryParse(raw, out val);

compared to that :

let raw = "1234"
let success, val = Int32.TryParse(raw)

?

Let me even rewrite first snippet of code in C#3 :

var raw = "1234";
int val; /* Too bad I cannot write declare val as var */
var success = int.TryParse(raw, out val);

As far as I can count, I have as many variable declarations.
Only differences are : semicolons, typed declaration(s) and order of declarations (val is declared before use in C#).

Maybe you'll find this disturbing, maybe you'll find that tuples rock, maybe you'll find that TryParse design sucks, but don't say this is because of verbosity.</description>
		<content:encoded><![CDATA[<p>Maybe I miss your point, but where do you see &#8220;a ton of useless supporting code&#8221; in this :</p>
<p>string raw = &#8220;1234&#8243;;<br />
int val; /* No need to initialize an out parameter */<br />
bool success = int.TryParse(raw, out val);</p>
<p>compared to that :</p>
<p>let raw = &#8220;1234&#8243;<br />
let success, val = Int32.TryParse(raw)</p>
<p>?</p>
<p>Let me even rewrite first snippet of code in C#3 :</p>
<p>var raw = &#8220;1234&#8243;;<br />
int val; /* Too bad I cannot write declare val as var */<br />
var success = int.TryParse(raw, out val);</p>
<p>As far as I can count, I have as many variable declarations.<br />
Only differences are : semicolons, typed declaration(s) and order of declarations (val is declared before use in C#).</p>
<p>Maybe you&#8217;ll find this disturbing, maybe you&#8217;ll find that tuples rock, maybe you&#8217;ll find that TryParse design sucks, but don&#8217;t say this is because of verbosity.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.289 seconds -->
