<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Fun Script</title>
	<atom:link href="http://pmougin.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://pmougin.wordpress.com</link>
	<description>Interactive Cocoa</description>
	<pubDate>Fri, 09 May 2008 21:36:41 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
	<language>en</language>
			<item>
		<title>F-Script for Experimenting with Cocoa</title>
		<link>http://pmougin.wordpress.com/2008/05/09/f-script-for-experimenting-with-cocoa/</link>
		<comments>http://pmougin.wordpress.com/2008/05/09/f-script-for-experimenting-with-cocoa/#comments</comments>
		<pubDate>Fri, 09 May 2008 21:36:09 +0000</pubDate>
		<dc:creator>Philippe Mougin</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[F-Script]]></category>

		<category><![CDATA[Smalltalk]]></category>

		<guid isPermaLink="false">http://pmougin.wordpress.com/?p=156</guid>
		<description><![CDATA[
As a follow-up to the Mac Developer Roundtable Episode 007, Colin Wheeler explains on Cocoa Samurai how he uses F-Script:


I&#39;m a huge fan of creating experimental projects and playing around with API&#39;s and that&#39;s one reason I&#39;m a fan of F-Script because then I don&#39;t have 30 small projects cluttering up my desktop or a [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>
As a follow-up to the <a href="http://www.macdevnet.com/index.php/shows/mdr/38-mdr/366-mdr007">Mac Developer Roundtable Episode 007</a>, Colin Wheeler explains on <a href="http://cocoasamurai.blogspot.com/2008/05/i-am-on-mac-developer-roundtable-007.html">Cocoa Samurai</a> how he uses F-Script:
</p>
<blockquote><p>
I&#39;m a huge fan of creating experimental projects and playing around with API&#39;s and that&#39;s one reason I&#39;m a fan of F-Script because then I don&#39;t have 30 small projects cluttering up my desktop or a temp directory and so now I do much less tiny projects in Xcode and use F-Script to see how the API&#39;s work.<br />
You can start F-Script up in a console and create an app from scratch or just create temp objects and see how they work and play around with Cocoa in a way that&#39;s not possible in Xcode without creating loads of small projects.<br />
You can download F-Script from <a href="http://www.fscript.org">http://www.fscript.org</a> though if you are on Leopard you will need to download and install a special version of FScript Anywhere from <a href="http://osiris.laya.com/blog/?p=24">http://osiris.laya.com/blog/?p=24</a>
</p></blockquote>
<p>
You can learn more on this in &quot;<a href="http://www.fscript.org/documentation/ExploringCocoaWithFScript/index.htm">Exploring Cocoa with F-Script</a>&quot;, an article that shows the graphical F-Script object browser and some other cool exploration tools in action.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pmougin.wordpress.com/156/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pmougin.wordpress.com/156/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/156/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=156&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2008/05/09/f-script-for-experimenting-with-cocoa/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Introduction to LINQ</title>
		<link>http://pmougin.wordpress.com/2008/04/14/introduction-to-linq/</link>
		<comments>http://pmougin.wordpress.com/2008/04/14/introduction-to-linq/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 17:57:44 +0000</pubDate>
		<dc:creator>Philippe Mougin</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://pmougin.wordpress.com/?p=155</guid>
		<description><![CDATA[
The Webcast of my Microsoft Techdays 2008 session, &#34;An Introduction to LINQ&#34;, is available (in french):
Part 1
Part 2
Part 3



On the same site you will find the Webcasts for over 300 sessions (in french) of the Microsoft Techdays 2008, including sessions on Visual Studio 2008, C# 3.0, Silverlight, SQL Server 2008, F# and more&#8230;
   [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>
The Webcast of <a href="http://pmougin.wordpress.com/2008/02/10/linq-f-script-and-speaking-at-the-techdays-2008-conference/">my Microsoft Techdays 2008 session</a>, <b>&quot;An Introduction to LINQ&quot;</b>, is available (in french):</p>
<p><a href="http://www.microsoft.com/france/vision/mstechdays08/WebcastMSDN.aspx?EID=64962a3a-9582-4d41-833a-e8a3e4fb986c">Part 1</a><br />
<a href="http://www.microsoft.com/france/vision/mstechdays08/WebcastMSDN.aspx?eID=7d9995e7-b49b-4d1d-958c-7648a6d29891">Part 2</a><br />
<a href="http://www.microsoft.com/france/vision/mstechdays08/WebcastMSDN.aspx?eID=7064058e-4a53-4d5c-ab08-1bf24a411954">Part 3</a>
</p>
<p><img src="http://pmougin.files.wordpress.com/2008/04/102-1254-2.png?w=500&h=240" border="0" width="500" height="240" align="texttop" /></p>
<p><img src="http://pmougin.files.wordpress.com/2008/04/102-1258.png?w=500&h=245" border="0" width="500" height="245" align="texttop" /></p>
<p>On the same site you will find the Webcasts for over 300 sessions (in french) of the <a href="http://www.microsoft.com/france/vision/mstechdays08/Default.aspx">Microsoft Techdays 2008</a>, including sessions on Visual Studio 2008, C# 3.0, Silverlight, SQL Server 2008, F# and more&#8230;</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pmougin.wordpress.com/155/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pmougin.wordpress.com/155/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/155/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=155&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2008/04/14/introduction-to-linq/feed/</wfw:commentRss>
	
		<media:content url="http://pmougin.files.wordpress.com/2008/04/102-1254-2.png" medium="image" />

		<media:content url="http://pmougin.files.wordpress.com/2008/04/102-1258.png" medium="image" />
	</item>
		<item>
		<title>Become an Xcoder, Leopard Edition</title>
		<link>http://pmougin.wordpress.com/2008/03/26/become-an-xcoder-leopard-edition/</link>
		<comments>http://pmougin.wordpress.com/2008/03/26/become-an-xcoder-leopard-edition/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 20:03:25 +0000</pubDate>
		<dc:creator>Philippe Mougin</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<guid isPermaLink="false">http://pmougin.wordpress.com/?p=152</guid>
		<description><![CDATA[
Become an Xcoder is a free little eBook we wrote to help beginners with no or little programming experience to start their journey into the world of Mac OS X development with Objective-C and Cocoa. (See Learn Cocoa for a recent discussion on this topic).
I&#8217;m glad to announce that the book has been updated for [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>
<b>Become an Xcoder</b> is a free little eBook we wrote to help beginners with no or little programming experience to start their journey into the world of Mac OS X development with Objective-C and Cocoa. (See <a href="http://pmougin.wordpress.com/2008/02/19/learn-cocoa/">Learn Cocoa</a> for a recent discussion on this topic).</p>
<p>I&#8217;m glad to announce that the book has been updated for Leopard and Xcode 3, thanks to the work of Alex Clarke (one of the original authors and our publisher at <a href="http://www.cocoalab.com">CocoaLab</a>).</p>
<p>You can download the PDF of this new edition:</p>
<p><a href="http://www.cocoalab.com/BecomeAnXcoder.pdf"><img src="http://pmougin.files.wordpress.com/2008/03/becomeanxcoderleopardedcover.png?w=128&h=179" border="0" width="128" height="179" align="texttop" /></a><br />
<br />
You can also access translations (not updated for Leopard yet) and a very nice HTML version of the book <a href="http://www.cocoalab.com/?q=becomeanxcoder">here at CocoaLab</a>. For exploring more advanced Cocoa topics, Alex has created <a href="http://www.cocoalab.com/?q=labnotes">LabNotes</a>, where you can find learning material, including hands-on exercises, on topics such as Cocoa bindings, MVC, accessors, etc.</p>
<p>So far the book has been quite successful, with nearly 100,000 downloads (which give me an opportunity to shamelessly brag about!). Interestingly, the number of downloads has increased in recent weeks. We have gone from an average of 400 downloads/week in January to 1000 in February to 2700 this month. I would not be surprised for this to be representative of a growing interest in Cocoa, amplified by the recent iPhone SDK announcement. I wonder if other Cocoa related web sites or publishers are seeing the same trend&#8230;<br />
Anyway, enjoy <i><a href="http://www.cocoalab.com/BecomeAnXcoder.pdf">Become an Xcoder, Leopard Edition</a></i>!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pmougin.wordpress.com/152/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pmougin.wordpress.com/152/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/152/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=152&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2008/03/26/become-an-xcoder-leopard-edition/feed/</wfw:commentRss>
	
		<media:content url="http://pmougin.files.wordpress.com/2008/03/becomeanxcoderleopardedcover.png" medium="image" />
	</item>
		<item>
		<title>Inspecting the Pasteboard with Drop Inspector</title>
		<link>http://pmougin.wordpress.com/2008/03/23/inspecting-the-pasteboard-with-drop-inspector/</link>
		<comments>http://pmougin.wordpress.com/2008/03/23/inspecting-the-pasteboard-with-drop-inspector/#comments</comments>
		<pubDate>Sun, 23 Mar 2008 19:41:43 +0000</pubDate>
		<dc:creator>Philippe Mougin</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[F-Script]]></category>

		<category><![CDATA[Smalltalk]]></category>

		<guid isPermaLink="false">http://pmougin.wordpress.com/?p=150</guid>
		<description><![CDATA[
Briksoftware has released Drop Inspector, a development utility that embeds an F-Script environment. Drop Inspector&#8217;s job is to let you inspect the contents of the pasteboard, including drag and drop data.
On Mac OS X, the pasteboard is a subsystem that allows sharing data between components or applications:

You typically use pasteboards in copy and paste operations, [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>
<a href="http://briksoftware.com/">Briksoftware</a> has released <a href="http://briksoftware.com/blog/?p=76">Drop Inspector</a>, a development utility that embeds an <a href="http://www.fscript.org">F-Script</a> environment. Drop Inspector&#8217;s job is to let you inspect the contents of the pasteboard, including drag and drop data.</p>
<p>On Mac OS X, the pasteboard is a subsystem that allows <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/CopyandPaste/CopyandPaste.html">sharing data between components or applications</a>:</p>
<blockquote>
<p>You typically use pasteboards in copy and paste operations, although pasteboards also provide the basis of system services. NSPasteboard objects transfer data to and from the pasteboard server. The server is shared by all running applications. It contains data that the user has cut or copied, as well as other data that one application wants to transfer to another. [...]</p>
<p>Data can be placed in the pasteboard server in more than one representation. For example, an image might be provided both in Tag Image File Format (TIFF) and as encapsulated PostScript code (EPS). Multiple representations give pasting applications the option of choosing which data type to use. In general, an application taking data from the pasteboard should choose the richest representation it can handle?rich text over plain ASCII, for example. An application putting data in the pasteboard should promise to supply it in as many data types as possible, so that as many different applications as possible can use it. [...]</p>
<p>The pasteboard owner declares the data types it can write. Pasteboard data generally refer to an object instance whether a string, an arbitrarily complex object graph such as a dictionary of arrays, an instance of NSData, or an object wrapper for an arbitrary block of data. You can name your own pasteboard types for special-purpose data types.
</p></blockquote>
<p>Drop Inspector provides access to pasteboards contents from an hexadecimal-view and the embedded F-Script environment. You get the full power of F-Script for inspecting and manipulating objects graphically. Nice!</p>
<p><img src="http://pmougin.files.wordpress.com/2008/03/dropinspector4.png?w=557&h=461" border="0" width="557" height="461" align="texttop" /></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pmougin.wordpress.com/150/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pmougin.wordpress.com/150/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/150/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=150&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2008/03/23/inspecting-the-pasteboard-with-drop-inspector/feed/</wfw:commentRss>
	
		<media:content url="http://pmougin.files.wordpress.com/2008/03/dropinspector4.png" medium="image" />
	</item>
		<item>
		<title>Tim Burks on Objective-C, Ruby, Lisp, bridges and beyond</title>
		<link>http://pmougin.wordpress.com/2008/03/22/tim-burks-on-objective-c-ruby-lisp-bridges-and-beyond/</link>
		<comments>http://pmougin.wordpress.com/2008/03/22/tim-burks-on-objective-c-ruby-lisp-bridges-and-beyond/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 20:50:55 +0000</pubDate>
		<dc:creator>Philippe Mougin</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<guid isPermaLink="false">http://pmougin.wordpress.com/?p=145</guid>
		<description><![CDATA[The video of Tim Burks C4 talk has just been released. 


Tim talks about Objective-C, Ruby/Objective-C bridges (including one he created), and his new baby, the Nu language. Nu is a dynamic language based on the Objective-C run-time, with a strong flavor of Lisp and Ruby.
Catch the other C4[1] videos here.
     [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The video of Tim Burks C4 talk <a href="http://www.viddler.com/explore/rentzsch/videos/13">has just been released</a>. </p>
<p><a href="http://www.viddler.com/explore/rentzsch/videos/13"><img src="http://pmougin.files.wordpress.com/2008/03/timburksc4.png?w=276&h=207" border="0" width="276" height="207" align="texttop" /><br />
</a></p>
<p>Tim talks about Objective-C, Ruby/Objective-C bridges (including one he created), and his new baby, the <a href="http://programming.nu/">Nu language</a>. Nu is a dynamic language based on the Objective-C run-time, with a strong flavor of Lisp and Ruby.</p>
<p>Catch the <a href="http://rentzsch.com/c4/c41VideosAvailable">other C4[1] videos here</a>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pmougin.wordpress.com/145/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pmougin.wordpress.com/145/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/145/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=145&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2008/03/22/tim-burks-on-objective-c-ruby-lisp-bridges-and-beyond/feed/</wfw:commentRss>
	
		<media:content url="http://pmougin.files.wordpress.com/2008/03/timburksc4.png" medium="image" />
	</item>
		<item>
		<title>Some Nice Features of the Objective-C Language</title>
		<link>http://pmougin.wordpress.com/2008/03/13/some-nice-features-of-the-objective-c-language/</link>
		<comments>http://pmougin.wordpress.com/2008/03/13/some-nice-features-of-the-objective-c-language/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 19:35:44 +0000</pubDate>
		<dc:creator>Philippe Mougin</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[Smalltalk]]></category>

		<guid isPermaLink="false">http://pmougin.wordpress.com/?p=143</guid>
		<description><![CDATA[Here is a little list of things that, in my experience, contribute to make Objective-C a powerful and fun programming language.
Classes are objects
Each class is an instance of a meta-class automatically created and managed by the run-time. We can define class methods, pass classes as arguments, put them in collections and so on. To create [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here is a little list of things that, in my experience, contribute to make Objective-C a powerful and fun programming language.</p>
<p><h3>Classes are objects</h3>
<p>Each class is an instance of a meta-class automatically created and managed by the run-time. We can define class methods, pass classes as arguments, put them in collections and so on. To create an object, we just send a message to the class we want to instantiate. No need to reinvent a &quot;factory&quot; system. No need for a specific constructor mechanism at the language level. This helps keeping the language simple and powerful.<br /> And, by the way, meta-classes are objects too!</p>
<h3>Dynamic typing</h3>
<p>As in Ruby, Python, Smalltalk, Groovy&#8230; Extremely useful because we don&#8217;t always know beforehand what our objects are going to be at run-time. Dynamic typing in Objective-C is simple to use. For example, this declares a variable that can hold a reference to an object:
<div class="codebox">
<pre><code>id myObject;</code></pre>
</div>
<h3>Optional static typing</h3>
<p>Still, Objective-C also has support for static typing. Best of both worlds.</p>
<p>This declares a variable that can hold a reference to an object of class (or subclass of) NSView:
<div class="codebox">
<pre><code>NSView *myObject;</code></pre>
</div>
<h3>Categories</h3>
<p>Categories let us define new methods and add them to classes for which we don&#8217;t have the source code (such as the standard Cocoa classes provided by Apple). This makes it easy to extend classes without resorting to subclassing. Extremely useful to adapt existing classes to the requirements of frameworks we want to use or create.</p>
<h3>Message sending</h3>
<p>We interact with objects by sending them messages. Often, the receiver of a message will have a method that directly matches the message (i.e. that has the same name, or, in Objective-C terms, the same selector). In this case the method will be invoked. But this is not the only possible outcome, as an object can choose to handle a message in other ways such as forwarding it to another object, broadcasting it to a number of objects, introspecting it and applying custom logic, etc.<br />
Very powerful&#8230;</p>
<h3>Expressive message syntax</h3>
<p>Message patterns in Objective-C are like natural language sentences with holes in them (prefixed with colons). When we write code that sends a message to an object, we fill the holes with actual values, creating a meaningful sentence. This way of denoting messages comes from Smalltalk and makes the code very expressive.</p>
<p>Example, sending a message to an ordered collection, asking it to insert a given object at index 10:</p>
<div class="codebox">
<pre><code>[<font color="GoldenRod">myCollection</font> insert:<span class="colored">myObject</span> atIndex:<span class="colored">10</span>]</code></pre>
</div>
<p>A message sending expressions can be read like a sentence where the receiver is the subject and the message is the rest of the sentence (for instance, an action that we would like the receiver to perform): &quot;myCollection insert myObject at index 10&quot;.</p>
<h3>Introspection</h3>
<p>Introspecting objects is easy. For example, we can ask an object for its class like this:</p>
<div class="codebox">
<pre><code>[myObject class]</code></pre>
</div>
<p>Determine if an object has a method &quot;foo&quot;:</p>
<div class="codebox">
<pre><code>[myObject respondsToSelector:@selector(foo)]</code></pre>
</div>
<p>Ask an object for the signature of its method &quot;foo&quot;:</p>
<div class="codebox">
<pre><code>[myObject methodSignatureForSelector:@selector(foo)]</code></pre>
</div>
<p>Ask a class whether it is a subclass of another class:</p>
<div class="codebox">
<pre><code>[class1 isSubclassOfClass:class2]</code></pre>
</div>
<p>And so on&#8230;</p>
<h3>Dynamic run-time</h3>
<p>Objective-C has a dynamic run-time. It allows crafting messages at run-time, dynamically creating classes, dynamically adding methods to existing classes, changing method implementations and so on&#8230;</p>
<p>For a nice example of what can be achieved with Objective-C introspection and dynamism you can have a look at <a href="http://www.fscript.org/documentation/ExploringCocoaWithFScript/index.htm">this article</a> I wrote about the graphical object browser provided by F-Script.</p>
<h3>Automatic garbage collection</h3>
<p>The automatic garbage collector runs in its own thread, concurrently with the application code. It uses a generational model to improve its efficiency by targeting in priority memory zones that are more likely to be garbage. It works for objects and also for raw C memory blocks allocated with the <code><span class="colored">NSAllocateCollactable()</span></code> and similar functions. <code><span class="colored">malloc()</span></code> works as usual, providing control over memory not managed by the collector.</p>
<p>The garbage collector is an opt-in service: you can choose to not make use of it in your application and instead rely on a reference counting system. This system includes a rather ingenious delayed release mechanism that goes a long way to reduce the burden of manual reference counting.<br /> <br />
Note that at the time of this writing, the automatic garbage collector is not available on the iPhone.</p>
<h3>C inside</h3>
<p>Objective-C is primarily an object-oriented extension to the C language and constitutes a superset of C. This means that the raw power of C is available, and that C libraries can be accessed directly (as you know, there is quite a number of them available out there!). Beside, this creates a symbiotic relationship between the language and the operating system, as Mac OS X, which is a UNIX system, is primarily written in C and, for the upper-level parts, in Objective-C.  </p>
<h3>C++ fluent</h3>
<p>Not only is Objective-C a superset of C but it can also understand and call C++ code. Used in this configuration, the language is named Objective-C++ and allows mixing Objective-C and C++ code in the same code statements. It also allows directly using C++ libraries.  </p>
<h3>Simplicity</h3>
<p>Objective-C&#8217;s Smalltalk-inspired object system is leaning toward simplicity. Many features that tend to render languages complex (templates, overloading, multiple inheritance, etc.) are simply absent from Objective-C, which offer simpler programming models taking advantage of its dynamic nature.</p>
<h3>Access to Apple technologies</h3>
<p>Each new version of Mac OS X, and now, of the iPhone OS, is full of interesting new technologies which are directly available from Objective-C to play with. This contributes significantly to make Objective-C fun to use.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pmougin.wordpress.com/143/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pmougin.wordpress.com/143/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/143/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=143&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2008/03/13/some-nice-features-of-the-objective-c-language/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ruby + ObjC = MacRuby</title>
		<link>http://pmougin.wordpress.com/2008/03/11/ruby-objc-macruby/</link>
		<comments>http://pmougin.wordpress.com/2008/03/11/ruby-objc-macruby/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 13:48:52 +0000</pubDate>
		<dc:creator>Philippe Mougin</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<guid isPermaLink="false">http://pmougin.wordpress.com/?p=142</guid>
		<description><![CDATA[Laurent Sansonetti, Apple&#39;s Ruby wizard, has released MacRuby, an Apple open source project which unifies Ruby and Cocoa (instead of just bridging them like RubyCocoa does).
 MacRuby is a version of Ruby that runs on top of Objective-C. More precisely, MacRuby is currently a port of the Ruby 1.9 implementation for the Objective-C runtime and [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Laurent Sansonetti, Apple&#39;s Ruby wizard, has released <a href="http://trac.macosforge.org/projects/ruby/wiki/MacRuby">MacRuby</a>, an Apple open source project which <em>unifies</em> Ruby and Cocoa (instead of just <em>bridging</em> them like <a href="http://rubycocoa.sourceforge.net/HomePage">RubyCocoa</a> does).</p>
<blockquote><p> MacRuby is a version of Ruby that runs on top of Objective-C. More precisely, MacRuby is currently a port of the Ruby 1.9 implementation for the Objective-C runtime and garbage collector.</p></blockquote>
<p>Laurent talks about the innards of MacRuby in <a href="http://www.infoq.com/news/2008/03/macruby-objectivec">this interview at InfoQ</a>:</p>
<blockquote><p> The Ruby object data structure had to be modified to conform to the Objective-C object data structure, so that a Ruby object can be casted at the C level as an Objective-C object. Then, the object allocator was modified to use the Objective-C one instead, which means that all objects (Ruby and Objective-C) are allocated from the same memory pool.<br /> <br />
Finally, the traditional Ruby garbage collector was removed and instead we use the Objective-C garbage collector. This change wasn&#39;t very easy because the collector runs by default in generational mode, and expects you to appropriately set &#8220;write-barriers&#8221; every time you register an object in the object store, because it collects young generation of objects based on this information. [<a href="http://www.infoq.com/news/2008/03/macruby-objectivec">Read more here</a>]</p></blockquote>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pmougin.wordpress.com/142/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pmougin.wordpress.com/142/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/142/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=142&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2008/03/11/ruby-objc-macruby/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Learn Cocoa</title>
		<link>http://pmougin.wordpress.com/2008/02/19/learn-cocoa/</link>
		<comments>http://pmougin.wordpress.com/2008/02/19/learn-cocoa/#comments</comments>
		<pubDate>Tue, 19 Feb 2008 22:03:21 +0000</pubDate>
		<dc:creator>Philippe Mougin</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[F-Script]]></category>

		<guid isPermaLink="false">http://pmougin.wordpress.com/?p=133</guid>
		<description><![CDATA[
I just stumbled upon Learning Cocoa, an interesting post at Engineering Hints that provides advices for beginners wanting to learn Cocoa. As a first step, the author suggests starting with our Become an Xcoder booklet:  

The first stage is to go through an excellent short PDF manual called Become an Xcoder. This really does [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>
I just stumbled upon <a href="http://splash6hints.blogspot.com/2008/01/over-last-few-months-ive-been-trying-to.html">Learning Cocoa</a>, an interesting post at <a href="http://splash6hints.blogspot.com">Engineering Hints</a> that provides advices for beginners wanting to learn Cocoa. As a first step, the author suggests starting with our <i>Become an Xcoder</i> booklet:  </p>
<blockquote><p>
The first stage is to go through an excellent short PDF manual called Become an Xcoder. This really does require no prior knowledge of C, C++ or any other language that most manuals assume the reader has. It gives the reader sufficient knowledge to understand what is happening in all the different sections of a project as well as working with basic classes such as arrays or strings.
</p></blockquote>
<p>The book is free and is published under a Creative Commons Attribution license. You can <a href="http://www.cocoalab.com/BecomeAnXcoder.pdf">download it</a> (PDF) or read it online and comment on it in a <a href="http://www.cocoalab.com/?q=node/5">dedicated Wiki at CocoaLab</a>.<br /> 
</p>
<p><a href="http://www.cocoalab.com/BecomeAnXcoder.pdf"><img src="http://pmougin.files.wordpress.com/2008/01/becomeanxcodercover2.png?w=149&h=209" border="0" width="149" height="209"></a></p>
<p>The project was started by Bert Altenburg and inspired by his famous <a href="http://www.fischer-bayern.de/as/as4as/AS4AS_e.pdf">AppleScript for Absolute Starters</a> guide. Alex Clarke, of <a href="http://www.cocoalab.com">CocoaLab</a>, joined us to write the book and also took on the duty of editing it.</p>
<p>By the time you read this, the book should have reached its 80,000th download.<br />
The original version is in english and, thanks to the work of Mazen ArRammal, Maria Shinoto, Nobuatsu Sekine and Shiva Huang, we now have translations in the following languages:</p>
<ul>
<li><a href="http://www.cocoalab.com/BecomeAnXcoder(Arabic).pdf">Arabic</a></li>
<li><a href="http://www.cocoalab.com/BecomeAnXcoder(Japanese).pdf">Japanese</a></li>
<li><a href="http://www.cocoalab.com/BecomeAnXcoder(SChinese).pdf">Simplified Chinese</a></li>
<li><a href="http://www.cocoalab.com/BecomeAnXcoder(TChinese).pdf">Traditional Chinese</a></li>
</ul>
<p>
<s>We haven&#8217;t updated it yet for Leopard&#8217;s Xcode 3, but most material is still relevant.</s> <i>March 2008 update: the book has been updated for Leopard and Xcode 3 (see <a href="http://pmougin.wordpress.com/2008/03/26/become-an-xcoder-leopard-edition/">this post</a>).</i>
</p>
<p>In addition to the resources reviewed in the <a href="http://splash6hints.blogspot.com/2008/01/over-last-few-months-ive-been-trying-to.html">Engineering Hints post</a> I&#8217;d like to point out that<a href="http://www.fscript.org"> F-Script</a> proves to be a useful tool for learning Cocoa, in conjunction with the Xcode toolset. F-Script provides an interactive environment where one can type snippets of Cocoa code, have them executed immediately, and visualize results. All without having to create a complete program and generating output. This interpreted environment also includes a set of tools allowing inspecting and manipulating live objects graphically. <a href="http://www.fscript.org/documentation/ExploringCocoaWithFScript/index.htm">This lets you explore Cocoa</a> and quickly experiment with APIs or algorithms you are working on.
</p>
<p>
<a href="http://www.fscript.org/documentation/index.htm"><img src="http://pmougin.files.wordpress.com/2008/01/findercapture001.png?w=135&h=190" border="0" width="135" height="190"></a>
</p>
<p>This is also an efficient and fun way to learn programming. Rob Abernathy wrote about this way of using F-Script:</p>
<blockquote><p>
Since I&#8217;ve downloaded and installed F-Script, my 7 year old son has been working through the tutorials for F-Script. Has been having a great time with it and is learning a great deal. F-Script is a great tool for teaching programming.
</p></blockquote>
<p>
Finally, Cocoa programmers of every age will have a lot of fun and learn a lot by browsing the wonderful <a href="http://osx.hyperjeff.net/reference/CocoaArticles.php">Cocoa Literature List</a> created by <a href="http://osx.hyperjeff.net/">HyperJeff</a>.</P></p>
<p><a href="http://osx.hyperjeff.net/reference/CocoaArticles.php"><img src="http://pmougin.files.wordpress.com/2008/01/aperucapture004.png?w=158&h=226" border="0" width="158" height="226"></a></p>
<p>
This is the entry point for a world of articles, tutorials and books about Cocoa technologies contributed by the developer community over the years. Hundreds and hundreds of them. Not only that, but it also comes with a great content search system. Check it out, it is full of gems!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pmougin.wordpress.com/133/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pmougin.wordpress.com/133/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/133/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=133&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2008/02/19/learn-cocoa/feed/</wfw:commentRss>
	
		<media:content url="http://pmougin.files.wordpress.com/2008/01/becomeanxcodercover2.png" medium="image" />

		<media:content url="http://pmougin.files.wordpress.com/2008/01/findercapture001.png" medium="image" />

		<media:content url="http://pmougin.files.wordpress.com/2008/01/aperucapture004.png" medium="image" />
	</item>
		<item>
		<title>LINQ, F-Script and Speaking at the TechDays 2008 Conference</title>
		<link>http://pmougin.wordpress.com/2008/02/10/linq-f-script-and-speaking-at-the-techdays-2008-conference/</link>
		<comments>http://pmougin.wordpress.com/2008/02/10/linq-f-script-and-speaking-at-the-techdays-2008-conference/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 22:21:55 +0000</pubDate>
		<dc:creator>Philippe Mougin</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[F-Script]]></category>

		<category><![CDATA[Smalltalk]]></category>

		<guid isPermaLink="false">http://pmougin.wordpress.com/?p=140</guid>
		<description><![CDATA[
Tomorrow, I&#39;ll be giving a talk at the Microsoft TechDays 2008 conference. This is the main developer-related Microsoft event here in France. There will be about 280 technical sessions and I&#8217;ve heard the organizers expect 15,000 attendees! The subject of my talk is LINQ, a set of new technologies added by Microsoft to languages such [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>
Tomorrow, I&#39;ll be giving a talk at the <a href="http://www.microsoft.com/france/mstechdays/">Microsoft TechDays 2008 conference</a>. This is the main developer-related Microsoft event here in France. There will be about 280 technical sessions and I&#8217;ve heard the organizers expect 15,000 attendees! The subject of my talk is LINQ, a set of new technologies added by Microsoft to languages such as C# and Visual Basic. LINQ aims at radically simplifying the way object-oriented languages deal with objects and other information models such as relational databases or XML infosets.
</p>
<p>
I&#39;ve been hooked on LINQ since the beginning, when its ideas started to be experimented in the context of the <a href="http://research.microsoft.com/comega/">C&omega; research project</a>. My buddy <a href="http://weblogs.asp.net/fmarguerie/">Fabrice Marguerie</a>, with whom I&#39;ll be giving the talk, describes LINQ in his new book, <a href="http://www.manning.com/marguerie/">LINQ in Action</a>:</p>
<p><a href="http://www.manning.com/marguerie/"><img src="http://pmougin.files.wordpress.com/2008/02/linqinaction.png?w=162&h=190" border="0" width="162" height="190" align="texttop" /></a></p>
<blockquote><p>
LINQ stands for Language Integrated Query. In a nutshell, it makes query operations like SQL statements into first-class citizens in .NET languages like C# and VB. LINQ offers built-in support for querying in-memory object collections such as arrays or lists, XML, DataSets, and relational databases. But LINQ is extensible and can be used to query various data sources [...]</p>
<p>In addition to offering novel approaches to deal with data, LINQ represents a shift toward declarative and functional programming. When people ask me for reasons to learn LINQ, I tell them that they should learn it in order to be able to use it with XML, relational data, or in-memory collections, but above all to be able to start using declarative programming, deferred execution, and lambda expressions.
</p></blockquote>
</p>
<p>
While <a href="http://msdn2.microsoft.com/en-us/library/bb308959.aspx">LINQ</a> and <a href="http://www.fscript.org/documentation/OOPAL.pdf">OOPAL</a> (the array programming model adopted by <a href="http://www.fscript.org">F-Script</a>) are based on very different principles, they share a common goal: providing a higher-level programming model that allows for more expressive and powerful language constructs. We can illustrate this with the following example, comparing some typical code in a classic object-oriented language (here, Java) with the code in C# with LINQ and F-Script with OOPAL.<br />
In this example we deal with the object model of an airplane company:</p>
<p><img src="http://pmougin.files.wordpress.com/2008/02/flightuml.png?w=281&h=270" border="0" width="281" height="270" align="texttop" /></p>
<p>Say we have a collection of flight objects named <code><span class="colored">flights</span></code>. Starting there, we want to get the names of the pilots in charge of a flight to Paris on a B747 airplane. And we want them sorted by salary in increasing order.
</p>
<p><h3>Java</h3>
<p></p>
<div class="codebox" style="overflow:auto;">
<pre><code>
TreeSet&lt;Pilot&gt; pilots = new TreeSet&lt;Pilot&gt;(new Comparator()
{
    public int compare(Object o1, Object o2)
    {
        if (((Pilot)o1).salary() &lt; ((Pilot)o2).salary())
            return -1;
        else if (((Pilot)o1).salary() == ((Pilot)o2).salary())
            return 0;
        else
            return 1;
    }
});

for (flight : flights)
{
    if (flight.arrivalLocation().equals("PARIS") &amp;&amp; flight.airplane().model.equals("B747"))
    {
        pilots.add(flight.pilot());
    }
}

ArrayList&lt;String&gt; result = new ArrayList&lt;String&gt;();

for (pilot : pilots)
{
    result.add(pilot.name());
}
</code></pre>
</div>
<h3>C# (with LINQ)</h3>
<p></p>
<div class="codebox" style="overflow:auto;">
<pre><code>
var pilots = (from flight in flights
              where flight.arrivalLocation == "Paris" &amp;&amp; flight.airplane.model == "B747"
              select flight.pilot).Distinct();

var result = from pilot in pilots
             orderby pilot.salary
             select pilot.name;
</code></pre>
</div>
<h3>F-Script (with OOPAL)</h3>
<p></p>
<div class="codebox" style="overflow:auto;">
<pre><code>
pilots := (flights at:flights arrivalLocation = 'PARIS' &amp; (flights airplane model = 'B747')) pilot distinct.

result := pilots name at:pilots salary sort.
</code></pre>
</div>
<p>
The three programs manipulate plain old standard objects (respectively Java, .NET and Cocoa objects). However, the programming models on which they are based differ and, as you can see, the C# and F-Script versions are shorter and more expressive.
</p>
<p>If you are around and want to know more about LINQ, you can <a href="http://galilee.microsoft.fr/TechDays2008/Session.aspx?CellID=64962a3a-9582-4d41-833a-e8a3e4fb986c">come to my session!</a></p></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pmougin.wordpress.com/140/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pmougin.wordpress.com/140/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/140/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=140&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2008/02/10/linq-f-script-and-speaking-at-the-techdays-2008-conference/feed/</wfw:commentRss>
	
		<media:content url="http://pmougin.files.wordpress.com/2008/02/linqinaction.png" medium="image" />

		<media:content url="http://pmougin.files.wordpress.com/2008/02/flightuml.png" medium="image" />
	</item>
		<item>
		<title>Mixing Objective-C and F-Script Source Code</title>
		<link>http://pmougin.wordpress.com/2008/02/07/mixing-objective-c-and-f-script-source-code/</link>
		<comments>http://pmougin.wordpress.com/2008/02/07/mixing-objective-c-and-f-script-source-code/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 20:54:00 +0000</pubDate>
		<dc:creator>Philippe Mougin</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[F-Script]]></category>

		<category><![CDATA[Smalltalk]]></category>

		<guid isPermaLink="false">http://pmougin.wordpress.com/?p=129</guid>
		<description><![CDATA[
F-Script can be used on its own or as a sub-language in Objective-C. This allows using F-Script&#8217;s object manipulation capacities (e.g., array programming) from Objective-C code without being forced to extend Objective-C itself. 
The sub-language term refers to the situation where some code in a given language is embedded in the source code of another [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>
<a href="http://www.fscript.org">F-Script</a> can be used on its own or as a sub-language in Objective-C. This allows using F-Script&#8217;s object manipulation capacities (e.g., array programming) from Objective-C code without being forced to extend Objective-C itself. </p>
<p>The <i>sub-language</i> term refers to the situation where some code in a given language is embedded in the source code of another program written in another language. For example, Java programmers can use SQL as a sub-language via the JDBC API. A sub-language may be used by a host language without requiring that the host language be extended or modified: the sub-language is integrated using a simple library.
</p>
<p>
This requires a way of exchanging data between the Objective-C and F-Script, i.e., we must be able to exchange any type of object. Sharing objects between different languages is not a simple matter. There are basically two solutions:</p>
<ol>
<li> Providing a run-time that bridges the object models of the two languages</li>
<li> Using the same object model in the two languages</li>
</ol>
<p>F-Script adopts the second, straightforward, approach. This allows any object to be exchanged between the two languages with no limitations. Both F-Script and Objective-C can freely share and manipulate the objects, because they are native to both languages.
</p>
<p>
For example, suppose we have an array of <code>NSWindow</code> objects in our Objective-C program. We want to put in front of the screen the windows in this array that contain an edited document. Moreover, we want the windows to be &#8220;front-sorted&#8221; according to the alphabetical order of their titles. Finally, we want to know how many of such &#8220;edited&#8221; windows are present in our array. We decide to write that little algorithm in F-Script, given how easy this is, and to put it right inside our Objective-C source code.</p>
<p>In F-Script, the parametrized block for performing the specified task would be:</p>
<div class="codebox" style="overflow:auto;">
<pre><code><font color="maroon">[ :w | w := w at:w isDocumentEdited. (w at:w title sort) reverse orderFront:nil; count]
</font></code></pre>
</div>
<p>This defines a block (aka closure or lambda) with a parameter named <code>w</code> that is used to pass the array of windows. The block uses the standard <code>isDocumentEdited</code> method provided by the AppKit to determine if a window is associated with an edited document. Such windows are selected, sorted and brought to front. Finally, their number is returned.</p>
<p>Using this code in Objective-C is easy. All we have to do is:</p>
<ol>
<li>Add FScript.framework to our project and add the following import directive in our Objective-C source file: <code>#import &lt;FScript/FScript.h&gt;</code>
<li>Put our F-Script code into an <code>NSString</code></li>
<li>Turn it into a block by sending the <code>asBlock</code> message to the string</li>
<li>Execute this block in the same way we would have done in F-Script: by sending it a <code>value:</code>message, passing our array of windows as argument (in the Objective-C example below, we pass an array that contains all the windows of the application). </li>
</ol>
<div class="codebox" style="overflow:auto;">
<pre><code>
NSArray *windows = [[NSApplication sharedApplication] windows];

NSNumber *count = [[@&quot;<font color="maroon">[ :w | w := w at:w isDocumentEdited. (w at:w title sort) reverse orderFront:nil; count]</font>&quot; asBlock] value:windows];

</code></pre>
</div>
<p>That&#8217;s all for today. Enjoy!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pmougin.wordpress.com/129/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pmougin.wordpress.com/129/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/129/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=129&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2008/02/07/mixing-objective-c-and-f-script-source-code/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>