<?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: The Many Humps of Ocaml, Part 1</title>
	<atom:link href="http://www.vector-seven.com/2007/07/06/the-many-humps-of-ocaml-part-1/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vector-seven.com/2007/07/06/the-many-humps-of-ocaml-part-1/</link>
	<description>My software development thoughts, experiments and discoveries</description>
	<pubDate>Sat, 17 May 2008 08:56:49 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Thomas Lee &#187; The Many Humps of Ocaml, Part 2</title>
		<link>http://www.vector-seven.com/2007/07/06/the-many-humps-of-ocaml-part-1/#comment-152</link>
		<dc:creator>Thomas Lee &#187; The Many Humps of Ocaml, Part 2</dc:creator>
		<pubDate>Wed, 03 Oct 2007 11:02:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.vector-seven.com/2007/07/06/the-many-humps-of-ocaml-part-1/#comment-152</guid>
		<description>[...] Many Humps of Ocaml, PreludeThe Many Humps of Ocaml, Part 1The Many Humps of Ocaml, Part 2    This entry is part 3 of 3 in the series, TMHOO. Welcome to part [...]</description>
		<content:encoded><![CDATA[<p>[...] Many Humps of Ocaml, PreludeThe Many Humps of Ocaml, Part 1The Many Humps of Ocaml, Part 2    This entry is part 3 of 3 in the series, TMHOO. Welcome to part [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Butler</title>
		<link>http://www.vector-seven.com/2007/07/06/the-many-humps-of-ocaml-part-1/#comment-43</link>
		<dc:creator>Paul Butler</dc:creator>
		<pubDate>Tue, 07 Aug 2007 18:36:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.vector-seven.com/2007/07/06/the-many-humps-of-ocaml-part-1/#comment-43</guid>
		<description>Nice tutorial. I look forward to seeing more. I agree that there is a general lack of ocaml tutorials around, although ocaml-tutorial.org is good.

I was a bit confused by the _ until this morning, when I realized it was more powerful than I thought. For example, you can automatically discard any argument of a function like this:

# let a b _ = b + 1;;
val a : int -&#62; 'a -&#62; int = 
# a 8 "carrot";;
- : int = 9

In this case it was useless, but it could come in handy when you need to pass a function with a certain signature but you don't want all the arguments.

Or you can use it when assigning values from a tuple:

let (client_sock, _) = accept listen_sock in...

In this case, accept returned a tuple and I only wanted the first value.</description>
		<content:encoded><![CDATA[<p>Nice tutorial. I look forward to seeing more. I agree that there is a general lack of ocaml tutorials around, although ocaml-tutorial.org is good.</p>
<p>I was a bit confused by the _ until this morning, when I realized it was more powerful than I thought. For example, you can automatically discard any argument of a function like this:</p>
<p># let a b _ = b + 1;;<br />
val a : int -&gt; &#8216;a -&gt; int =<br />
# a 8 &#8220;carrot&#8221;;;<br />
- : int = 9</p>
<p>In this case it was useless, but it could come in handy when you need to pass a function with a certain signature but you don&#8217;t want all the arguments.</p>
<p>Or you can use it when assigning values from a tuple:</p>
<p>let (client_sock, _) = accept listen_sock in&#8230;</p>
<p>In this case, accept returned a tuple and I only wanted the first value.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Volker Grabsch</title>
		<link>http://www.vector-seven.com/2007/07/06/the-many-humps-of-ocaml-part-1/#comment-42</link>
		<dc:creator>Volker Grabsch</dc:creator>
		<pubDate>Tue, 07 Aug 2007 11:03:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.vector-seven.com/2007/07/06/the-many-humps-of-ocaml-part-1/#comment-42</guid>
		<description>You're learning OCaml and you seem to be a fan of SDL. (I saw your Ruby/SDL article.)

So maybe my article about OCaml+SDL is interesting for you:

http://wiki.njh.eu/OCaml_and_SDL</description>
		<content:encoded><![CDATA[<p>You&#8217;re learning OCaml and you seem to be a fan of SDL. (I saw your Ruby/SDL article.)</p>
<p>So maybe my article about OCaml+SDL is interesting for you:</p>
<p><a href="http://wiki.njh.eu/OCaml_and_SDL" rel="nofollow">http://wiki.njh.eu/OCaml_and_SDL</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ozonew4mWebmaster</title>
		<link>http://www.vector-seven.com/2007/07/06/the-many-humps-of-ocaml-part-1/#comment-32</link>
		<dc:creator>Ozonew4mWebmaster</dc:creator>
		<pubDate>Fri, 20 Jul 2007 08:20:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.vector-seven.com/2007/07/06/the-many-humps-of-ocaml-part-1/#comment-32</guid>
		<description>Just wanted to say cool blog :)

cool blog !!

there you go i said it ;)</description>
		<content:encoded><![CDATA[<p>Just wanted to say cool blog <img src='http://www.vector-seven.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>cool blog !!</p>
<p>there you go i said it <img src='http://www.vector-seven.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adrien F.</title>
		<link>http://www.vector-seven.com/2007/07/06/the-many-humps-of-ocaml-part-1/#comment-27</link>
		<dc:creator>Adrien F.</dc:creator>
		<pubDate>Wed, 18 Jul 2007 14:20:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.vector-seven.com/2007/07/06/the-many-humps-of-ocaml-part-1/#comment-27</guid>
		<description>That's it : 
"Now we have an unusual let-binding. let _ = expression means "calculate the value of the expression (with all the side-effects that may entail), but throw away the result"."
source : http://www.ocaml-tutorial.org/the_structure_of_ocaml_programs</description>
		<content:encoded><![CDATA[<p>That&#8217;s it :<br />
&#8220;Now we have an unusual let-binding. let _ = expression means &#8220;calculate the value of the expression (with all the side-effects that may entail), but throw away the result&#8221;.&#8221;<br />
source : <a href="http://www.ocaml-tutorial.org/the_structure_of_ocaml_programs" rel="nofollow">http://www.ocaml-tutorial.org/the_structure_of_ocaml_programs</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tom</title>
		<link>http://www.vector-seven.com/2007/07/06/the-many-humps-of-ocaml-part-1/#comment-26</link>
		<dc:creator>tom</dc:creator>
		<pubDate>Wed, 18 Jul 2007 11:19:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.vector-seven.com/2007/07/06/the-many-humps-of-ocaml-part-1/#comment-26</guid>
		<description>Thanks Adrien! Just before I update the tutorial though, I'd like to get my terminology right: would it be fair to say that

let _ = main () ;;

simply discards the unit value returned by evaluating main () ?</description>
		<content:encoded><![CDATA[<p>Thanks Adrien! Just before I update the tutorial though, I&#8217;d like to get my terminology right: would it be fair to say that</p>
<p>let _ = main () ;;</p>
<p>simply discards the unit value returned by evaluating main () ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adrien F.</title>
		<link>http://www.vector-seven.com/2007/07/06/the-many-humps-of-ocaml-part-1/#comment-25</link>
		<dc:creator>Adrien F.</dc:creator>
		<pubDate>Wed, 18 Jul 2007 09:50:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.vector-seven.com/2007/07/06/the-many-humps-of-ocaml-part-1/#comment-25</guid>
		<description>Two little tips : 
First, in OCaml, the ";;" are not necessary, second, you should(nt use calls as "main ();;" in the middle of nowhere.

I'd say your hello world should be written this way :

let _ = 
  print_endline "Hello World!"

If you really wan't a wrapper around that print_endline, you could use : 

let main () = print_endline "Hello World!"

let _ = main ()


Adrien :)</description>
		<content:encoded><![CDATA[<p>Two little tips :<br />
First, in OCaml, the &#8220;;;&#8221; are not necessary, second, you should(nt use calls as &#8220;main ();;&#8221; in the middle of nowhere.</p>
<p>I&#8217;d say your hello world should be written this way :</p>
<p>let _ =<br />
  print_endline &#8220;Hello World!&#8221;</p>
<p>If you really wan&#8217;t a wrapper around that print_endline, you could use : </p>
<p>let main () = print_endline &#8220;Hello World!&#8221;</p>
<p>let _ = main ()</p>
<p>Adrien <img src='http://www.vector-seven.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Harrop</title>
		<link>http://www.vector-seven.com/2007/07/06/the-many-humps-of-ocaml-part-1/#comment-23</link>
		<dc:creator>Jon Harrop</dc:creator>
		<pubDate>Sat, 14 Jul 2007 21:59:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.vector-seven.com/2007/07/06/the-many-humps-of-ocaml-part-1/#comment-23</guid>
		<description>Great intro! :-)</description>
		<content:encoded><![CDATA[<p>Great intro! <img src='http://www.vector-seven.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tom</title>
		<link>http://www.vector-seven.com/2007/07/06/the-many-humps-of-ocaml-part-1/#comment-21</link>
		<dc:creator>tom</dc:creator>
		<pubDate>Wed, 11 Jul 2007 21:44:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.vector-seven.com/2007/07/06/the-many-humps-of-ocaml-part-1/#comment-21</guid>
		<description>Paul: Noted! I'll update the tutorial tonight.

Chris: I'm going to do some further research into OCaml references and get back to you. From what I've seen so far they have more in common with C++ pointers than Java.  Of course, that's not to say they're the *same* as C++ pointers (e.g. from my understanding you can't increment OCaml references). Obviously I'm the newbie here, this has just been my experience so far. If you can offer me any such examples where OCaml references are similar to those in Java, or where OCaml references deviate entirely from either language it'd be much appreciated.

Thanks very much for your input guys :)</description>
		<content:encoded><![CDATA[<p>Paul: Noted! I&#8217;ll update the tutorial tonight.</p>
<p>Chris: I&#8217;m going to do some further research into OCaml references and get back to you. From what I&#8217;ve seen so far they have more in common with C++ pointers than Java.  Of course, that&#8217;s not to say they&#8217;re the *same* as C++ pointers (e.g. from my understanding you can&#8217;t increment OCaml references). Obviously I&#8217;m the newbie here, this has just been my experience so far. If you can offer me any such examples where OCaml references are similar to those in Java, or where OCaml references deviate entirely from either language it&#8217;d be much appreciated.</p>
<p>Thanks very much for your input guys <img src='http://www.vector-seven.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Smith</title>
		<link>http://www.vector-seven.com/2007/07/06/the-many-humps-of-ocaml-part-1/#comment-20</link>
		<dc:creator>Chris Smith</dc:creator>
		<pubDate>Wed, 11 Jul 2007 15:31:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.vector-seven.com/2007/07/06/the-many-humps-of-ocaml-part-1/#comment-20</guid>
		<description>I gotta say I think you're mistaken in saying that OCaml references are more like C++ pointers than Java.  The similarity with C++ pointers goes no deeper than syntax -- the fact that dereferencing is a stand-alone operator rather than part of the '.' and '[]' syntax.  OCaml's references don't share many characteristics with either C++ or Java's pointers, but they are certainly closer to Java than C++.</description>
		<content:encoded><![CDATA[<p>I gotta say I think you&#8217;re mistaken in saying that OCaml references are more like C++ pointers than Java.  The similarity with C++ pointers goes no deeper than syntax &#8212; the fact that dereferencing is a stand-alone operator rather than part of the &#8216;.&#8217; and &#8216;[]&#8216; syntax.  OCaml&#8217;s references don&#8217;t share many characteristics with either C++ or Java&#8217;s pointers, but they are certainly closer to Java than C++.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

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