<?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:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" 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>
	<lastBuildDate>Tue, 24 Nov 2009 21:02:34 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='pmougin.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/18a48d05d51f88508e207d7c7817465b?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Fun Script</title>
		<link>http://pmougin.wordpress.com</link>
	</image>
			<item>
		<title>Writing Mac OS X applications in Smalltalk</title>
		<link>http://pmougin.wordpress.com/2009/11/24/writing-mac-os-x-applications-in-smalltalk/</link>
		<comments>http://pmougin.wordpress.com/2009/11/24/writing-mac-os-x-applications-in-smalltalk/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 20:55: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=1421</guid>
		<description><![CDATA[Jonathan Sterling discusses writing fully native Cocoa applications in Smalltalk with F-Script in &#34;Writing Mac OS X applications in Smalltalk&#34;

What I really wanted was a version of Smalltalk that used the same object model as Objective-C, like Pragmatic Smalltalk of Etoil&#233;, or even MacRuby on Mac OS. Most of all, I wanted it to treat [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1421&subd=pmougin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Jonathan Sterling discusses writing fully native Cocoa applications in Smalltalk with <a href="http://www.fscript.org/">F-Script</a> in &quot;<a href="http://blog.jonmsterling.com/2009/09/20/writing-mac-os-x-applications-in-smalltalk.html">Writing Mac OS X applications in Smalltalk</a>&quot;
</p>
<blockquote><p>What I really wanted was a version of Smalltalk that used the same object model as Objective-C, like Pragmatic Smalltalk of Etoil&eacute;, or even MacRuby on Mac OS. Most of all, I wanted it to treat me like an adult: I don&#39;t need a class browser, thank you, I&#39;m more comfortable working with plain-old files. The persistent image construct in Smalltalk really makes me uncomfortable. Eventually, I found F-Script, a scripting environment for Mac OS based on Smalltalk. It is not really meant for developing full applications, but with a little work, I was able to make this work. <a href="http://blog.jonmsterling.com/2009/09/20/writing-mac-os-x-applications-in-smalltalk.html">Read more&#8230;</a>
</p></blockquote>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/1421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/1421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/1421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/1421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/1421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/1421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/1421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/1421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/1421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/1421/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1421&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2009/11/24/writing-mac-os-x-applications-in-smalltalk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pmougin</media:title>
		</media:content>
	</item>
		<item>
		<title>Using F-Script as a debugging tool</title>
		<link>http://pmougin.wordpress.com/2009/11/19/using-f-script-as-a-debugging-tool/</link>
		<comments>http://pmougin.wordpress.com/2009/11/19/using-f-script-as-a-debugging-tool/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 13:45:36 +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=1284</guid>
		<description><![CDATA[Fabian Schuiki explains how F-Script can be used as a debugging tool when developing Cocoa applications in &#34;F-Script: The Ultimate Debugging Console&#34;.

If it weren&#8217;t for F-Script, I would have spent 5 hours today writing debugging code and creating some testing UI for Artifica which would have been another source for bugs which increases complexity of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1284&subd=pmougin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Fabian Schuiki explains how <a href="http://www.fscript.org/">F-Script</a> can be used as a debugging tool when developing Cocoa applications in &quot;<a href="http://blog.axamblis.com/?p=87">F-Script: The Ultimate Debugging Console</a>&quot;.</p>
<blockquote><p>
If it weren&#8217;t for F-Script, I would have spent 5 hours today writing debugging code and creating some testing UI for Artifica which would have been another source for bugs which increases complexity of the debugging process again. <i>F-Script gives you the possibility to completely split up the development of your object model and your view model</i>, which not only saves you a lot of time and is more productive, but is also less frustrating since you never have to go figure whether your app&#8217;s functionality is broken due to a bug in the UI, the object model or even worse, somewhere in between. <a href="http://blog.axamblis.com/?p=87">Read more&#8230;</a>
</p></blockquote>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/1284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/1284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/1284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/1284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/1284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/1284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/1284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/1284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/1284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/1284/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1284&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2009/11/19/using-f-script-as-a-debugging-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pmougin</media:title>
		</media:content>
	</item>
		<item>
		<title>Joint Ruby and Smalltalk BlockCamp in Paris</title>
		<link>http://pmougin.wordpress.com/2009/11/18/joint-ruby-and-smalltalk-blockcamp-in-paris/</link>
		<comments>http://pmougin.wordpress.com/2009/11/18/joint-ruby-and-smalltalk-blockcamp-in-paris/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 10:18:05 +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=1403</guid>
		<description><![CDATA[
The french Ruby and Smalltalk communities are organizing the first BlockCamp event in Paris on the 28th november 2009. I will be there and will talk about F-Script 2.0. Come join us! More information here&#8230;
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1403&subd=pmougin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img src="http://pmougin.files.wordpress.com/2009/11/logo_blockamp.jpg?w=300&#038;h=300" alt="Joint Ruby and Smalltalk BlockCamp in Paris" border="0" width="300" height="300" /></p>
<p align="justify">The french Ruby and Smalltalk communities are organizing the first BlockCamp event in Paris on the 28th november 2009. I will be there and will talk about F-Script 2.0. Come join us! <a href="http://www.facebook.com/event.php?eid=176109665285">More information here&#8230;</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/1403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/1403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/1403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/1403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/1403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/1403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/1403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/1403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/1403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/1403/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1403&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2009/11/18/joint-ruby-and-smalltalk-blockcamp-in-paris/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pmougin</media:title>
		</media:content>

		<media:content url="http://pmougin.files.wordpress.com/2009/11/logo_blockamp.jpg" medium="image">
			<media:title type="html">Joint Ruby and Smalltalk BlockCamp in Paris</media:title>
		</media:content>
	</item>
		<item>
		<title>Reprogram your Cocoa applications on the fly!</title>
		<link>http://pmougin.wordpress.com/2009/11/18/reprogram-your-cocoa-applications-on-the-fly/</link>
		<comments>http://pmougin.wordpress.com/2009/11/18/reprogram-your-cocoa-applications-on-the-fly/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 09:17:57 +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=1396</guid>
		<description><![CDATA[In this fun video clip, it takes Jeff only a few seconds to bring support for Snow Leopard&#8217;s text substitutions to WriteRoom&#8230; Cool demo of F-Script injection, for those unfamiliar with it.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1396&subd=pmougin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p align="justify">In this fun <a href="http://blog.hyperjeff.net/?p=162">video clip</a>, it takes Jeff only a few seconds to bring support for Snow Leopard&#8217;s text substitutions to WriteRoom&#8230; Cool demo of F-Script injection, for those unfamiliar with it.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/1396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/1396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/1396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/1396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/1396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/1396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/1396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/1396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/1396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/1396/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1396&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2009/11/18/reprogram-your-cocoa-applications-on-the-fly/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pmougin</media:title>
		</media:content>
	</item>
		<item>
		<title>Beyond Blocks</title>
		<link>http://pmougin.wordpress.com/2009/11/17/beyond-blocks/</link>
		<comments>http://pmougin.wordpress.com/2009/11/17/beyond-blocks/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 11:06:32 +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=1207</guid>
		<description><![CDATA[Blocks (aka lambda expressions or closures) are versatile and powerful. I like them. I have even implemented a programming language in which they play a central role.
However, for a number of common programming situations, I think that some alternative approaches based on higher order messaging provide better solutions than classic block-based approaches. Marcel Weiher provides [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1207&subd=pmougin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p align="justify">Blocks (aka lambda expressions or closures) are versatile and powerful. I like them. I have even implemented a programming language in which they play a central role.</p>
<p align="justify">However, for a number of common programming situations, I think that some alternative approaches based on higher order messaging provide better solutions than classic block-based approaches. Marcel Weiher provides a good example in <a href="http://www.metaobject.com/blog/2009/11/blocked-c.html">Blocked-C</a>. He shows some Objective-C code that uses a block to iterate over a collection of strings and to create a new collection with some suffix added to the original strings:</p>
<div class="codebox" style="overflow:auto;color:white;background-color:#153E7E;">
<pre><code> NSMutableArray *filteredItems = [NSMutableArray array];
 [items enumerateObjects WithOptions:0 withBlock:
    ^(id item, NSUInteger index, BOOL *stop) {
       [filteredItems addObject:[item stringByAppendingString:@"suffix"]];
    }
 ];
</code></pre>
</div>
<p align="justify">Then, he goes on to show how the same can be achieved using a higher order messaging (HOM) technique:</p>
<div class="codebox" style="overflow:auto;color:white;background-color:#153E7E;">
<pre><code> [[items collect] stringByAppendingString:@"suffix"];
</code></pre>
</div>
<p align="justify">The conciseness and expressiveness of the HOM version is impressive and should at the very least warrant further examination. Regarding this, we are lucky since this approach, and its application to Objective-C, is described in an OOPSLA paper titled &quot;Higher Order Messaging&quot; (<a href="http://www.metaobject.com/papers/Higher_Order_Messaging_OOPSLA_2005.pdf">download</a>).</p>
<p align="justify">With some support in the programming language, higher order messaging techniques can go even further. <a href="http://www.fscript.org/">F-Script</a> is a Smalltalk dialect for Cocoa which extends Smalltalk with array programming and <i>messaging patterns</i>. Messaging pattern is a generalization of message sending that applies to entire collections of objects. In a number of common situations, this provides an interesting alternative to the classic block-based approach. Indeed, here is our example coded in F-Script:</p>
<div class="codebox" style="overflow:auto;color:white;background-color:#153E7E;">
<pre><code> items stringByAppendingString:'suffix'.
</code></pre>
</div>
<p align="justify">A key aspect of this programming model (and of Weiher&#8217;s HOM) is that it liberates us from the classic &quot;one object at a time&quot; style, and lets us manipulate whole collections of objects at once, using higher level constructs. We are freed from the low level details of accessing and dealing with individual elements. In my experience, introducing array programming in object-oriented programming, as F-Script does, has positive effects similar to those of the introduction of vectors in math, which is quite nice&#8230; This model is described in another OOPSLA paper titled &quot;OOPAL: Integrating Array Programming in Object-Oriented Programming&quot; (<a href="http://www.fscript.org/documentation/OOPAL.pdf">download</a>)</p>
<p align="justify">To get a better sense of this programming model, let&#8217;s see how it stacks up against classic block based approaches for collections manipulation as seen in Ruby and Smalltalk. For the same price, I also add Python&#8217;s list comprehensions and C# Linq to the mix. In some common situations, those are interesting alternatives to blocks that are still representative of the &quot;one object at a time&quot; approach.</p>
<p align="justify">In the example below, we have a list of songs (a collection of Song objects) and we want to get their names. Here is how we&#8217;d do it using various approaches:</p>
<ul>
<li>Smalltalk and Ruby with blocks</li>
<li>Python with list comprehension</li>
<li>C# with Linq</li>
<li>F-Script with array programming</li>
</ul>
<table style="color:white;">
<tr>
<td style="padding:10px;" bgcolor="#151B54">Smalltalk</td>
<td style="padding:10px;" bgcolor="#153E7E"><code>songs collect:[:aSong| aSong name]</code></td>
</tr>
<tr>
<td style="padding:10px;" bgcolor="#151B54">Ruby</td>
<td style="padding:10px;" bgcolor="#153E7E"><code>songs.collect(&amp;:name)</code></td>
</tr>
<tr>
<td style="padding:10px;" bgcolor="#151B54">Python</td>
<td style="padding:10px;" bgcolor="#153E7E"><code>[aSong.name() for aSong in songs]</code></td>
</tr>
<tr>
<td style="padding:10px;" bgcolor="#151B54">C#</td>
<td style="padding:10px;" bgcolor="#153E7E"><code>from aSong in songs select aSong.name()</code></td>
</tr>
<tr>
<td style="padding:10px;" bgcolor="#151B54">F-Script</td>
<td style="padding:10px;" bgcolor="#153E7E"><code>songs name</code></td>
</tr>
</table>
<p align="justify">We can note that the array programming version (F-Script) is free from syntactic noise and low-level iteration logic, as is the brain of the programmer. Actually, in that particular situation, it seems hard to do better.</p>
<p>For the ruby version, we use a feature adopted in Ruby 1.9, which allows for automatic conversion of symbols to blocks. This is a useful trick as it provides a way, in some situations, to have a compact notation for some kind of blocks. Note, however, that when we need to provide more that just a method name, we have to use the classic Ruby block notation. This is the case in our original example (i.e., invoking the <code>stringByAppendingString</code> method with a given argument), for which we would have to do: <code>items.collect {|item| item.stringByAppendingString("suffix")}</code>.</p>
<p align="justify">We can carry on the comparison further by introducing some need for filtering. In the following example, we want to get the names of songs with a bit rate greater than or equal to 256 kb/s.</p>
<table style="color:white;">
<tr>
<td style="padding:10px;" bgcolor="#151B54">Smalltalk</td>
<td style="padding:10px;" bgcolor="#153E7E"><code>(songs select:[:aSong| aSong bitRate &gt;= 256]) collect:[:aSong| aSong name] </code></td>
</tr>
<tr>
<td style="padding:10px;" bgcolor="#151B54">Ruby</td>
<td style="padding:10px;" bgcolor="#153E7E"><code>songs.select {|aSong| aSong.bitRate &gt;= 256}.collect(&amp;:name)</code></td>
</tr>
<tr>
<td style="padding:10px;" bgcolor="#151B54">Python</td>
<td style="padding:10px;" bgcolor="#153E7E"><code>[aSong.name() for aSong in songs if aSong.bitRate() &gt;= 256]</code></td>
</tr>
<tr>
<td style="padding:10px;" bgcolor="#151B54">C#</td>
<td style="padding:10px;" bgcolor="#153E7E"><code>from aSong in songs select aSong.name() where aSong.bitRate() &gt;= 256 </code></td>
</tr>
<tr>
<td style="padding:10px;" bgcolor="#151B54">F-Script</td>
<td style="padding:10px;" bgcolor="#153E7E"><code>songs name where: songs bitRate &gt;= 256</code></td>
</tr>
</table>
<p align="justify">We see that the F-Script programming model allows for conciseness and expressiveness. Note that, in F-Script, <code>where:</code> is not a keyword or a special construct. It is just a regular message selector. The <code>where:</code> method, defined in a category of NSArray, takes an array of booleans as argument and returns the elements of the receiver whose positional matching element in this boolean array is true. Such boolean array is exactly what is produced by the expression <code>songs bitRate &gt;= 256</code>, as messages are automatically broadcasted to each individual elements of the receivers (i.e., the <code>bitRate</code> message is sent to each element of the <code>songs</code> array, producing an array of numbers whose elements are then sent the <code>&gt;= 256</code> message, producing the array of booleans). This is the powerful <i>compression</i> operation of array programming adapted to object-oriented programming.</p>
<p align="justify">Finally, here is an example of sorting a collection of objects. In this example, we want to create a sorted collection of our songs, sorting on the songs&#8217; names. In the case of Python, since its list comprehensions don&#8217;t have specific support for sorting, we use a solution based on lambda expressions.</p>
<table style="color:white;">
<tr>
<td style="padding:10px;" bgcolor="#151B54">Smalltalk</td>
<td style="padding:10px;" bgcolor="#153E7E"><code>songs asSortedCollection:[:song1 :song2| song1 name &lt; song2 name]</code></td>
</tr>
<tr>
<td style="padding:10px;" bgcolor="#151B54">Ruby</td>
<td style="padding:10px;" bgcolor="#153E7E"><code>songs.sort_by(&amp;:name)</code></td>
</tr>
<tr>
<td style="padding:10px;" bgcolor="#151B54">Python</td>
<td style="padding:10px;" bgcolor="#153E7E"><code>sorted(songs, key=lambda aSong: aSong name)</code></td>
</tr>
<tr>
<td style="padding:10px;" bgcolor="#151B54">C#</td>
<td style="padding:10px;" bgcolor="#153E7E"><code>from aSong in songs orderby aSong.name() select aSong</code></td>
</tr>
<tr>
<td style="padding:10px;" bgcolor="#151B54">F-Script</td>
<td style="padding:10px;" bgcolor="#153E7E"><code>songs at: songs name sort</code></td>
</tr>
</table>
<p align="justify">As in the previous examples, the F-Script version shows that we can do sophisticated collection manipulation without relying on blocks but only using message passing. The result of the <code>sort</code> message sent to the array of song names is an array of integers containing the indices that will arrange the receiver of <code>sort</code> in ascending order. We then pass this array of indices to the <code>at:</code> method. The <code>at:</code> method allows for indexing an array by either a single integer or a whole array of indices. This is this latter capability, a fundamental element of array programming, that we use here to produce our sorted list of songs.</p>
<h3>Conclusion</h3>
<p align="justify">Blocks are great, especially in programming languages which don&#8217;t have (and don&#8217;t want) specific syntax for classic control structures (if/then/else, while, etc.). However, we should take them with a grain of salt and see that, for some common problems, there are alternative approaches that are worth considering.</p>
<h3>Further reading</h3>
<p><a href="http://www.fscript.org">F-Script documentation set</a><br />
<a href="http://www.metaobject.com/blog/2009/11/blocked-c-ii.html">Blocked-C II</a><br />
<a href="http://www.stanford.edu/class/cs242/readings/backus.pdf">Can Programming Be Liberated from the von Neumann Style? A Functional Style and Its Algebra of Programs</a></p>
<h3>Special bonus</h3>
<p align="justify">You can easily, and interactively, experiment with the code provided in the examples: launch F-Script.app, connect to iTunes and immediately start querying and manipulating your iTunes song collection from F-Script.</p>
<p align="justify">You connect to iTunes using the standard Cocoa Scripting Bridge technology. For example, you can enter the following code in the F-Script console:</p>
<div class="codebox" style="overflow:auto;color:white;background-color:#153E7E;">
<pre><code>iTunes := SBApplication applicationWithBundleIdentifier:'com.apple.iTunes'
</code></pre>
</div>
<p align="justify">The <code>iTunes</code> variable now points to a dynamically generated Cocoa object that stands for the iTunes application.</p>
<p align="justify">You can get at your songs with:</p>
<div class="codebox" style="overflow:auto;color:white;background-color:#153E7E;">
<pre><code> songs := ((iTunes sources at:0) playlists at:1) tracks
</code></pre>
</div>
<p align="justify">You can then directly paste, in the console, the code of the examples provided in this article. If your song library is huge you might notice some latency, as Cocoa messages are automatically converted to Apple Events that flow back and forth between F-Script and iTunes.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/1207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/1207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/1207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/1207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/1207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/1207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/1207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/1207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/1207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/1207/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1207&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2009/11/17/beyond-blocks/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pmougin</media:title>
		</media:content>
	</item>
		<item>
		<title>Stepwise</title>
		<link>http://pmougin.wordpress.com/2009/11/16/stepwise/</link>
		<comments>http://pmougin.wordpress.com/2009/11/16/stepwise/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 21:14:49 +0000</pubDate>
		<dc:creator>Philippe Mougin</dc:creator>
				<category><![CDATA[Cocoa]]></category>

		<guid isPermaLink="false">http://pmougin.wordpress.com/?p=1346</guid>
		<description><![CDATA[Stepwise has been removed from the universe. It was one of my favorite Web sites back in the 90&#8217;s and, I think, a mythical place for many NeXT and early Mac OS X developers. I remember, among other things, the wonderful WWDC reports published there.
Thanks to Scott Anguish and everyone involved.
     [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1346&subd=pmougin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.stepwise.com/">Stepwise</a> has been removed from the universe. It was one of my favorite Web sites back in the 90&#8217;s and, I think, a mythical place for many NeXT and early Mac OS X developers. I remember, among other things, the wonderful WWDC reports published there.</p>
<p>Thanks to Scott Anguish and everyone involved.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/1346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/1346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/1346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/1346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/1346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/1346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/1346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/1346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/1346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/1346/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1346&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2009/11/16/stepwise/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pmougin</media:title>
		</media:content>
	</item>
		<item>
		<title>NSConference</title>
		<link>http://pmougin.wordpress.com/2009/11/15/nsconference/</link>
		<comments>http://pmougin.wordpress.com/2009/11/15/nsconference/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 23:56:14 +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=1326</guid>
		<description><![CDATA[
The NSConference 2010 setup looks great. I&#8217;ve been lucky to attend and speak at the 2009 edition, which was terrific, thanks to the vision, work and human qualities of the folks at MDN, Steve Scott and Tim Isted. The videos of the 2009 edition are all available for purchase. This includes the talk I gave [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1326&subd=pmougin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.nsconference.com/"><img src="http://pmougin.files.wordpress.com/2009/11/nsconf20102.png?w=357&#038;h=100" border="0" width="357" height="100" /></a></p>
<p>The <a href="http://www.nsconference.com/">NSConference 2010</a> setup looks great. I&#8217;ve been lucky to attend and speak at the 2009 edition, <a href="http://mattgemmell.com/2009/05/01/nsconference-2009">which was terrific</a>, thanks to the vision, work and human qualities of the folks at <a href="http://www.mac-developer-network.com">MDN</a>, Steve Scott and Tim Isted. The videos of the 2009 edition are all <a href="http://www.mac-developer-network.com/featured/nscon2009videos/">available for purchase</a>. This includes the talk I gave on &#8220;New Cocoa programming superpowers&#8221;.</p>
<div> <a href="http://www.mac-developer-network.com/featured/nscon2009videos/"><img src="http://pmougin.files.wordpress.com/2009/11/nsconf2010session.png?w=362" border="0" width="362"></a></div>
<p>There are also a number of backstage and interview videos at <a href="http://pomcast.com">Pomcast.com</a> (search for &quot;NSConf&quot;), including the super geeky <a href="http://pomcast.com/2009/05/25/72hacking/">Hacking F-Script &amp; Pick&amp;Play</a>, starring Jason Harris, and the <a href="http://www.youtube.com/watch?v=WFegEKT5StI">french F-Script interview in the dark</a>.     </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/1326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/1326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/1326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/1326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/1326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/1326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/1326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/1326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/1326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/1326/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1326&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2009/11/15/nsconference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pmougin</media:title>
		</media:content>

		<media:content url="http://pmougin.files.wordpress.com/2009/11/nsconf20102.png" medium="image" />

		<media:content url="http://pmougin.files.wordpress.com/2009/11/nsconf2010session.png" medium="image" />
	</item>
		<item>
		<title>Fun with F-Script Anywhere</title>
		<link>http://pmougin.wordpress.com/2009/11/11/fun-with-f-script-anywhere/</link>
		<comments>http://pmougin.wordpress.com/2009/11/11/fun-with-f-script-anywhere/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 18:33:30 +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=1258</guid>
		<description><![CDATA[C&#233;dric Luthi takes control of Preview.app with F-Script Anywhere in &#34;Watch a large number of icons with Preview.app&#34;.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1258&subd=pmougin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>C&eacute;dric Luthi takes control of Preview.app with F-Script Anywhere in &quot;<a href="http://0xced.blogspot.com/2009/11/watch-large-number-of-icons-with.html">Watch a large number of icons with Preview.app</a>&quot;.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/1258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/1258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/1258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/1258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/1258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/1258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/1258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/1258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/1258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/1258/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1258&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2009/11/11/fun-with-f-script-anywhere/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pmougin</media:title>
		</media:content>
	</item>
		<item>
		<title>Ultimate proof that the Finder is now a Cocoa application</title>
		<link>http://pmougin.wordpress.com/2009/10/28/ultimate-proof-that-the-finder-is-now-a-cocoa-application/</link>
		<comments>http://pmougin.wordpress.com/2009/10/28/ultimate-proof-that-the-finder-is-now-a-cocoa-application/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 10:36:48 +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=1107</guid>
		<description><![CDATA[F-Script injected into the Finder:

Looking around with the object browser. Cocoa all over the place! 

The NSApplication singleton and its delegate&#8230; So cute!

Have you ever seen the Finder&#8217;s Cover Flow from the inside? Look at that setFog: method on the IKImageFlowCell&#8230; Yummy!

Ultimate proof that the Finder makes use of bindings: 

Seems that the names of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1107&subd=pmougin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.fscript.org/">F-Script</a> injected into the Finder:</p>
<div><img src="http://pmougin.files.wordpress.com/2009/10/fsfinder0.png?w=521&#038;h=406" border="0" width="521" height="406" /></div>
<p>Looking around with the object browser. Cocoa all over the place! </p>
<div><img src="http://pmougin.files.wordpress.com/2009/10/fsfinder12.png?w=513&#038;h=459" border="0" width="513" height="459" /></div>
<p>The NSApplication singleton and its delegate&#8230; So cute!</p>
<div><img src="http://pmougin.files.wordpress.com/2009/10/fsfinder2.png?w=461&#038;h=558" border="0" width="461" height="558" /></div>
<p>Have you ever seen the Finder&#8217;s Cover Flow from the inside? Look at that setFog: method on the IKImageFlowCell&#8230; Yummy!</p>
<div><img src="http://pmougin.files.wordpress.com/2009/10/fsfinder32.png?w=531&#038;h=446" border="0" width="531" height="446" /></div>
<p>Ultimate proof that the Finder makes use of bindings: </p>
<div><img src="http://pmougin.files.wordpress.com/2009/10/fsfinder8.png?w=418&#038;h=490" border="0" width="418" height="490" /></div>
<p>Seems that the names of the Finder specific classes start with &#8216;T&#8217;. Oh well&#8230; </p>
<div><img src="http://pmougin.files.wordpress.com/2009/10/fsfinder4.png?w=512&#038;h=446" border="0" width="512" height="446" /></div>
<p>Don&#8217;t click on that &#8220;switchToSimpleFinder&#8221; method or else&#8230;
<div><img src="http://pmougin.files.wordpress.com/2009/10/fsfinder5.png?w=405&#038;h=150" border="0" width="405" height="150" /></div>
<p>That black Cover Flow background is boring. With F-Script, we can change it to something more disco!</p>
<div><img src="http://pmougin.files.wordpress.com/2009/10/fsfinder62.png?w=513&#038;h=396" border="0" width="513" height="396" /></div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/1107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/1107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/1107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/1107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/1107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/1107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/1107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/1107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/1107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/1107/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1107&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2009/10/28/ultimate-proof-that-the-finder-is-now-a-cocoa-application/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pmougin</media:title>
		</media:content>

		<media:content url="http://pmougin.files.wordpress.com/2009/10/fsfinder0.png" medium="image" />

		<media:content url="http://pmougin.files.wordpress.com/2009/10/fsfinder12.png" medium="image" />

		<media:content url="http://pmougin.files.wordpress.com/2009/10/fsfinder2.png" medium="image" />

		<media:content url="http://pmougin.files.wordpress.com/2009/10/fsfinder32.png" medium="image" />

		<media:content url="http://pmougin.files.wordpress.com/2009/10/fsfinder8.png" medium="image" />

		<media:content url="http://pmougin.files.wordpress.com/2009/10/fsfinder4.png" medium="image" />

		<media:content url="http://pmougin.files.wordpress.com/2009/10/fsfinder5.png" medium="image" />

		<media:content url="http://pmougin.files.wordpress.com/2009/10/fsfinder62.png" medium="image" />
	</item>
		<item>
		<title>What&#8217;s new in F-Script 2.0</title>
		<link>http://pmougin.wordpress.com/2009/10/28/whats-new-in-f-script-2-0/</link>
		<comments>http://pmougin.wordpress.com/2009/10/28/whats-new-in-f-script-2-0/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 09:16:17 +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=1088</guid>
		<description><![CDATA[
Garbage collection
New in F-Script 2.0 is a fast, concurrent, generational garbage collector. It was a lot of work to implement. Fortunately, Apple did all of it, as F-Script 2.0 uses the new Objective-C garbage collector. As with Objective-C, when you run F-Script in GC mode you no longer have to manage retain counts and to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1088&subd=pmougin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><br />
<h3>Garbage collection</h3>
<p>New in <a href="http://www.fscript.org">F-Script 2.0</a> is a fast, concurrent, generational garbage collector. It was a lot of work to implement. Fortunately, Apple did all of it, as F-Script 2.0 uses the new Objective-C garbage collector. As with Objective-C, when you run F-Script in GC mode you no longer have to manage retain counts and to care for cyclic references. You can still use F-Script in non-GC mode, which is needed if you want to interact with non-GC capable frameworks or libraries. A new option in the F-Script preference panel let you choose your memory management model. Finally, you can embed F-Script in GC or non-GC applications.</p>
<p>Garbage collection is performed concurrently, on its own thread. Another notable aspect is that it works both for objects and for raw memory buffers. Actually, for raw memory buffers, you can either use managed or unmanaged memory. F-Script 2.0 lets you use unmanaged memory as usual (i.e., with the malloc: method) and introduces new methods, in the FSPointer class, for dealing with managed memory. Features such as weak references, explicit GC control, etc. are all available from F-Script using the standard methods provided by Cocoa.</p>
<h3>64-bit</h3>
<p>F-Script 2.0 provides 64-bit support. Benefits include:</p>
<ul>
<li>Very large virtual address space</li>
<li>New Objective-C runtime (optimized message dispatching, zero-cost setup model for exceptions, etc.)</li>
<li>Ability to load 64-bit frameworks in F-Script and to embed F-Script in 64-bit applications</li>
</ul>
<p>You can still run in 32-bit mode and you can use the F-Script framework in 64-bit and 32-bit applications.<br />
The F-Script API itself now exposes both 64-bit and 32-bit capable interfaces, using Cocoa&#8217;s NSInteger, NSUInteger and CGFloat macros.
</p>
<h3>New object browser</h3>
<p>The graphical object browser gains a new look and a number of enhancements. This includes:</p>
<ul>
<li>Introspection of Objective-C 2.0 properties</li>
<li>Improved introspection of bindings</li>
<li>Direct access to the view hierarchy</li>
<li>Visual feedback when selecting graphical components on screen</li>
<li>Additional information about standards Cocoa objects</li>
<li>And more&#8230;</li>
</ul>
<p>
<b>Companion article: Exploring Cocoa with F-Script</b><br />
Discover the graphical object browser and object inspectors in this in-depth article.</p>
<table>
<tr>
<td>
      <a href="http://www.fscript.org/documentation/ExploringCocoaWithFScript/index.htm"><IMG BORDER="0" src="http://www.fscript.org/documentation/WelcomeToFScript2/artwork/ObjectBrowser.png"></a>
	</td>
<td>
      &nbsp;&nbsp;&nbsp;
    </td>
<td valign="top">
<blockquote><p>
      If you are a Cocoa developer, you already know that the dynamic nature of Objective-C and Cocoa is what makes them so flexible and powerful. In terms of development tools, the power of a dynamic object-oriented environment like Cocoa translates into original tools like Interface Builder or F-Script, an open source project that is presented in this article. F-Script is an integrated set of tools that makes it possible to interactively explore and manipulate Cocoa objects as well as script them using new high-level programming techniques. This article shows you how to use some of its most impressive features and demonstrates how it can be a useful addition to your developer toolkit. <a href="http://www.fscript.org/documentation/ExploringCocoaWithFScript/index.htm">Read more&#8230;</a>
      </p></blockquote>
</td>
</tr>
</table>
<h3>Dynamic Cocoa class creation</h3>
<p>
F-Script 2.0 makes it very easy to dynamically define new classes. At run-time, these dynamically generated classes are regular Cocoa classes that happen to execute F-Script code instead of compiled Objective-C code. They can be used from both F-Script and Objective-C. You can subclass existing Cocoa classes in F-Script and, as in Objective-C, define instance variables, instance methods and class methods. In addition, F-Script also supports defining <a href="http://www.mimuw.edu.pl/~sl/teaching/00_01/Delfin_EC/Glossary.htm#class%20instance%20variable" target="_blank">class instance variables</a>.</p>
<p>
<b>Companion article: Creating Cocoa Classes with F-Script</b></p>
<table>
<tr>
<td>
      <a href="http://www.fscript.org/documentation/CreatingCocoaClassesWithFScript/index.htm"><IMG BORDER="0" src="http://www.fscript.org/documentation/WelcomeToFScript2/artwork/CreatingClasses.png"></a>
	</td>
<td>
      &nbsp;&nbsp;&nbsp;
    </td>
<td valign="top">
<blockquote><p>
      F-Script 2.0 provides a handy syntax for dynamically creating Cocoa classes on the fly. This is useful for quickly experimenting, prototyping and using Cocoa interactively, as well as for developing sophisticated programs. You can type a class definition in the F-script console, hit return and immediately start playing with your new class. This article provides a quick introduction to this feature. <a href="http://www.fscript.org/documentation/CreatingCocoaClassesWithFScript/index.htm">Read more&#8230;</a>
      </p></blockquote>
</td>
</tr>
</table>
<h3>System-wide scripting</h3>
<p>
F-Script 2.0 is able to control scriptable applications and graphically browse and interact with the applications scripting interfaces. This major new feature is based on the MAC OS X Scripting Bridge technology. For example, here is how you can connect to iTunes:</p>
<pre class="codebox"><code><span class="identifier">iTunes</span> := <span class="identifier">SBApplication</span> <span class="selector">applicationWithBundleIdentifier:</span><span class="string">'com.apple.iTunes'</span></code></pre>
<p>You can then manipulate iTunes from F-script. For example, here is how you make iTunes go to the next track:</p>
<pre class="codebox"><code><span class="identifier">iTunes</span> <span class="selector">nextTrack</span>
</code></pre>
<p><b>Companion article: System-wide Scripting with F-Script</b><br />
Learn how to script your applications with this tutorial.</p>
<table>
<tr>
<td>
      <a href="http://www.fscript.org/documentation/SystemWideScriptingWithFScript/index.htm"><IMG BORDER="0" src="http://www.fscript.org/documentation/WelcomeToFScript2/artwork/SystemWideScripting.png"></a>
	</td>
<td>
      &nbsp;&nbsp;&nbsp;
    </td>
<td valign="top">
<blockquote><p>
Like AppleScript, F-Script can communicate with scriptable application, making it possible to automate processes using these applications and to create workflows spanning multiple applications. This system-wide scripting capability relies on a standard Mac OS X technology called the Scripting Bridge.<br />
Basically, the scripting bridge allows manipulating scriptable applications as if they were Cocoa objects, automatically taking care of the communication details (e.g. creating and sending Apple Events). This allows using F-Script to manipulate other applications through their standard scripting interface. <a href="http://www.fscript.org/documentation/SystemWideScriptingWithFScript/index.htm">Read More&#8230;</a>
      </p></blockquote>
</td>
</tr>
</table>
<h3>Updated embedding and injecting capabilities</h3>
<p>
F-Script can be easily embedded into your own applications or dynamically injected at runtime into any running Cocoa application. Embedding is great for adding scripting or interactive object querying/manipulation capabilities to your applications, as well as for implementing parts of your apps with F-Script. Injecting is incredibly powerful when it comes to debugging or exploring the innards of applications. F-Script 2 comes with full support for the new plugin model of Interface Builder 3, allowing drag and drop of F-Script graphical components right into your application. F-Script 2 also includes updated injecting tools (aka F-Script Anywhere) which lets you inject a complete F-Script environment at run time into any Cocoa application.</p>
<p>
<b>Companion article: Embedding F-Script into Cocoa Applications</b></p>
<table>
<tr>
<td>
      <a href="http://www.fscript.org/documentation/EmbeddingFScriptIntoCocoa/index.htm"><IMG BORDER="0" src="http://www.fscript.org/documentation/WelcomeToFScript2/artwork/Embedding.png"></a>
	</td>
<td>
      &nbsp;&nbsp;&nbsp;
    </td>
<td valign="top">
<blockquote><p>
All F-Script functionalities are available through components which can be integrated into applications. This enables you to:</p>
<ul>
<li>Program all or part of an application using the F-Script language.</li>
<li>Offer a scripting environment within your applications, allowing users to manipulate your business objects and to automate processes.</li>
<li>Interface F-Script with other tools.</li>
</ul>
<p>Because F-Script and Cocoa share the same object model, integration is easy and advanced. <a href="http://www.fscript.org/documentation/EmbeddingFScriptIntoCocoa/index.htm">Read more&#8230;</a>
      </p></blockquote>
</td>
</tr>
</table>
<h3>Refined syntax and class library</h3>
<p>
F-Script is a Smalltalk dialect. As such, its syntax is well suited to the manipulation of Objective-C objects, since Objective-C itself borrowed its messaging syntax from Smalltalk. F-Script 2.0 introduces several syntax refinements, including a handy notation for specifying dictionaries. Here is how an NSMutableDictionary instance with two entries looks like:</p>
<pre class="codebox"><code>#{key1 -&gt; value1, key2 -&gt; value2}</code></pre>
<p>There are other syntax enhancements including support for Unicode in string literals and a hexadecimal notation for numbers. Besides, the base class library has been refined, with new methods for dealing with collections, new globals for easy access to the standards IO streams, a new facility for comparing objects with the special nil value and some changes in the way test for object equality is performed. It is also worth noting the introduction of a new public class, FSAssociation, which represents associations between two objects, a &#8220;key&#8221; and a &#8220;value&#8221;, and is primarily used for specifying dictionary entries.</p>
<p>If you are not familiar with the F-Script syntax and fundamental elements, the two articles referenced below will get you up to speed in a breeze.
</p>
<p>
<b>Companion article: Learn F-Script in 20 Minutes and Have Fun Playing with Core Image</b></p>
<table>
<tr>
<td>
      <a href="http://www.fscript.org/documentation/LearnFScriptIn20Minutes/index.htm"><IMG BORDER="0" src="http://www.fscript.org/documentation/WelcomeToFScript2/artwork/LearnFScriptIn20Minutes.png"></a>
	</td>
<td>
      &nbsp;&nbsp;&nbsp;
    </td>
<td valign="top">
<blockquote><p>
      In this article, our goal will be to produce a nice little animation using fancy Core Image effects. In doing so, we will learn the basics of F-Script. So install yourself comfortably in front of your Mac, download the latest F-Script version from http://www.fscript.org and enjoy the trip! <a href="http://www.fscript.org/documentation/LearnFScriptIn20Minutes/index.htm">Read more&#8230;</a>
      </p></blockquote>
</td>
</tr>
</table>
<p>
<b>Companion article: Scripting Cocoa with F-Script</b></p>
<table>
<tr>
<td>
      <a href="http://www.fscript.org/documentation/ScriptingCocoaWithFScript/index.htm"><IMG BORDER="0" src="http://www.fscript.org/documentation/WelcomeToFScript2/artwork/ScriptingCocoaWithFScript.png"></a>
	</td>
<td>
      &nbsp;&nbsp;&nbsp;
    </td>
<td valign="top">
<blockquote><p>
One important application of Cocoa&#8217;s openness is its integration with scripting languages. This is very useful because it allows for interactive use and easy gluing of Cocoa components. In this article I want to give you a taste of Cocoa scripting, and to show you the level of integration that you can expect. We will use F-Script, an open source scripting language for Cocoa, to build a little graphical application. Using F-Script, we will directly program against the Application Kit, which is the Cocoa object framework for graphical user interfaces. <a href="http://www.fscript.org/documentation/ScriptingCocoaWithFScript/index.htm">Read more&#8230;</a>      </p></blockquote>
</td>
</tr>
</table>
<h3>Snow Leopard</h3>
<p>
F-Script 2 is compatible with both Leopard and Snow Leopard. It lets you directly access a number of the latest Mac OS X frameworks. And other ones are just a simple loading instruction away.</p>
<p>
<b>Companion article: Accessing Mac OS X Frameworks with F-Script</b></p>
<table>
<tr>
<td>
      <a href="http://www.fscript.org/documentation/AccessingMacOSXFrameworksWithFScript/index.htm"><IMG BORDER="0" src="http://www.fscript.org/documentation/WelcomeToFScript2/artwork/AccessingMacOSXFrameworksWithFScript.png"></a>
	</td>
<td>
      &nbsp;&nbsp;&nbsp;
    </td>
<td valign="top">
<blockquote><p>
F-Script.app, the standalone F-Script environment, is automatically linked with a number of Mac OS X frameworks. This is convenient for quickly exploring Mac OS X&#8217;s capabilities and directly using the frameworks without any further configuration. <a href="http://www.fscript.org/documentation/AccessingMacOSXFrameworksWithFScript/index.htm">Read more&#8230;</a>
      </p></blockquote>
</td>
</tr>
</table>
<h3>New project infrastructure</h3>
<p>The source code for F-Script is now <a href="http://github.com/pmougin/F-Script">available at Github</a>.</p>
<p>New group for support and discussions: <a href="http://groups.google.com/group/f-script">http://groups.google.com/group/f-script/</a>.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/1088/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/1088/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/1088/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/1088/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/1088/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/1088/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/1088/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/1088/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/1088/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/1088/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1088&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2009/10/28/whats-new-in-f-script-2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pmougin</media:title>
		</media:content>
	</item>
	</channel>
</rss>