<?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: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>Wed, 28 Oct 2009 14:26:29 +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>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>
		<item>
		<title>Switching in F-Script</title>
		<link>http://pmougin.wordpress.com/2009/10/27/switching-in-f-script/</link>
		<comments>http://pmougin.wordpress.com/2009/10/27/switching-in-f-script/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 09:52:44 +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=1076</guid>
		<description><![CDATA[There is no switch/case statement or method in F-Script and Smalltalk. Usually, switching is done by taking advantage of object polymorphism or by simply nesting ifTrue:IfFalse: messages. For example, here is some C pseudo code with a switch statement:

switch (aValue)
{
    case 1: doSomething1;
          [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1076&subd=pmougin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>There is no <code>switch/case</code> statement or method in F-Script and Smalltalk. Usually, switching is done by taking advantage of object polymorphism or by simply nesting <code>ifTrue:IfFalse:</code> messages. For example, here is some C pseudo code with a switch statement:</p>
<div class="codebox" style="overflow:auto;">
<pre><code>switch (aValue)
{
    case 1: doSomething1;
            break;
    case 2: doSomething2;
            break;
    case 3: doSomething3;
            break;
}
</code></pre>
</div>
<p>We can write equivalent code in F-Script using <code>ifTrue:IfFalse:</code> messages:</p>
<div class="codebox" style="overflow:auto;">
<pre><code>aValue = 1 ifTrue:[doSomething1] ifFalse:[
aValue = 2 ifTrue:[doSomething2] ifFalse:[
aValue = 3 ifTrue:[doSomething3]]]
</code></pre>
</div>
<p>Another possible technique is based on blocks and dictionary lookup. Basically, we construct a dictionary whose keys are the various cases&#8217; values we want to check against and whose values are blocks of code to execute. We then do a lookup in the dictionary and execute the selected block. With our example, this gives:</p>
<div class="codebox" style="overflow:auto;">
<pre><code>cases := #{
  1 -&gt; [doSomething1],
  2 -&gt; [doSomething2],
  3 -&gt; [doSomething3]
}.
(cases objectForKey:aValue) value
</code></pre>
</div>
<p>Searching for <a href="http://www.google.com/search?q=smalltalk+switch+case">Smalltalk switch case</a> on the Web will get you to additional techniques and discussions on emulating switch statements. </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/1076/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/1076/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/1076/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/1076/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/1076/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/1076/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/1076/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/1076/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/1076/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/1076/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1076&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2009/10/27/switching-in-f-script/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>F-Script 2.0.2 released</title>
		<link>http://pmougin.wordpress.com/2009/10/26/f-script-2-0-2-released/</link>
		<comments>http://pmougin.wordpress.com/2009/10/26/f-script-2-0-2-released/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 21:24:50 +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=1066</guid>
		<description><![CDATA[F-Script 2.0.2 is now available at  http://www.fscript.org/download/F-Script20091026.zip 
This version improves integration with Snow Leopard and fixes a memory management bug in the F-Script class creation system when running in reference counting mode. You are advised to upgrade. 
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1066&subd=pmougin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>F-Script 2.0.2 is now available at <a href="http://www.fscript.org/download/F-Script20091026.zip"> http://www.fscript.org/download/F-Script20091026.zip </a></p>
<p>This version improves integration with Snow Leopard and fixes a memory management bug in the F-Script class creation system when running in reference counting mode. You are advised to upgrade. </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/1066/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/1066/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/1066/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/1066/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/1066/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/1066/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/1066/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/1066/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/1066/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/1066/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1066&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2009/10/26/f-script-2-0-2-released/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>F-Script anywhere on Snowie</title>
		<link>http://pmougin.wordpress.com/2009/08/29/f-script-anywhere-on-snowy/</link>
		<comments>http://pmougin.wordpress.com/2009/08/29/f-script-anywhere-on-snowy/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 16:46: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=1023</guid>
		<description><![CDATA[
F-Script Anywhere is this amazing utility that lets you dynamically inject a complete F-Script environment into any Cocoa application at run-time. Kind of the ultimate tool to explore and take control of applications from the inside.


Unfortunately, the current version does not work on Snow Leopard&#8230; But we have a workaround! It is included in a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1023&subd=pmougin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>
F-Script Anywhere is this amazing utility that lets you dynamically inject a complete F-Script environment into any Cocoa application at run-time. Kind of the ultimate tool to explore and take control of applications from the inside.
</p>
<p>
Unfortunately, the current version does not work on Snow Leopard&#8230; But we have a workaround! It is included in a new distribution that has just been made available: F-Script 2.0.1 (<a href="http://www.fscript.org/download/F-Script20090829.zip">download</a>).
</p>
<p>
It is very simple to use. I&#8217;ll show you how it works and how to automate it.
</p>
<h3>Injecting F-Script into an application</h3>
<ol>
<li>Locate the F-Script framework on your disk. The F-Script framework is part of the F-Script distribution and is named &#8220;FScript.framework&#8221;. In the following, we assume you put it in /Library/Frameworks/</li>
<p></p>
<li>Open the UNIX terminal and launch gdb by typing:
<pre class="codebox"><code>gdb</code></pre>
<p>Note that if gdb is not on your system, you can get it by installing the Xcode package provided on the installation DVD of Mac OS X.
</li>
<p></p>
<li>Attach gdb to the target application, using the &#8220;attach&#8221; instruction. For example, to attach to TextEdit type:
<pre class="codebox"><code>attach TextEdit</code></pre>
</li>
<p></p>
<li>Load the F-Script framework into the target application by typing the following (we assume the F-Script framework is located at /Library/Frameworks/FScript.framework. Modify the command if this is not the case):
<pre class="codebox"><code>p (char)[[NSBundle bundleWithPath:@"/Library/Frameworks/FScript.framework"] load]</code></pre>
</li>
<p></p>
<li>Add an F-Script menu to the target application by typing:
<pre class="codebox"><code>p (void)[FScriptMenuItem insertInMainMenu]</code></pre>
</li>
<p></p>
<li> Let the application run by typing:
<pre class="codebox"><code>continue</code></pre>
</li>
<p>
</ol>
<p>An F-Script menu should now appear in the menu bar of the target application. Using it, you can access the injected F-Script environment and play with the application from the inside.</p>
<div style="text-align:center;"><img src="http://pmougin.files.wordpress.com/2009/08/fsatexteditsnow1.png?w=524&#038;h=408" border="0" width="524" height="408" /></div>
</p>
<h3>Automating the injection procedure</h3>
<p>Those steps are easy to automate by defining a new gdb command. To have this new command permanently available in gdb, you can add its definition to a .gdbinit file (a text file) that you put in your home directory. Your .gdbinit file is automatically executed each time gdb is launched. Here is the command definition that you can put in your .gdbinit file: </p>
<pre class="codebox"><code>define loadfs
    attach $arg0
    p (char)[[NSBundle bundleWithPath:@"/Library/Frameworks/FScript.framework"] load]
    p (void)[FScriptMenuItem insertInMainMenu]
    continue
end
</code></pre>
<p>This defines a command named <code>loadfs</code> that takes the name of the application you want to inject into as argument.</p>
<p>For example, to inject F-Script into TextEdit you can type the following in gdb:</p>
<pre class="codebox"><code>loadfs TextEdit</code></pre>
<p>This automates steps 3 to 6.
</p>
<p>Thanks to Ken Ferry for suggesting this injection technique.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/1023/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/1023/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/1023/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/1023/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/1023/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1023&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2009/08/29/f-script-anywhere-on-snowy/feed/</wfw:commentRss>
		<slash:comments>2</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/08/fsatexteditsnow1.png" medium="image" />
	</item>
		<item>
		<title>F-Script 2.0</title>
		<link>http://pmougin.wordpress.com/2009/08/17/f-script-2-0/</link>
		<comments>http://pmougin.wordpress.com/2009/08/17/f-script-2-0/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 21:52:42 +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=1013</guid>
		<description><![CDATA[F-Script 2.0 is now available.
Companion article: Welcome to F-Script 2.0.
Enjoy!
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1013&subd=pmougin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>F-Script 2.0 is now available.</p>
<p>Companion article: <a href="http://www.fscript.org/documentation/WelcomeToFScript2/index.htm">Welcome to F-Script 2.0</a>.</p>
<p>Enjoy!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/1013/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/1013/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/1013/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/1013/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/1013/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/1013/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/1013/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/1013/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/1013/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/1013/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=1013&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2009/08/17/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>
		<item>
		<title>F-Script fun: animating views</title>
		<link>http://pmougin.wordpress.com/2009/08/14/f-script-fun-animating-views/</link>
		<comments>http://pmougin.wordpress.com/2009/08/14/f-script-fun-animating-views/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 12:19:15 +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=961</guid>
		<description><![CDATA[Also on oyasuhisa, a cool demo of animating views into crazy transparent windows, making use of Cocoa&#8217;s animation techniques. (download).

I reproduce the code below (slightly modified), so you just have to copy and paste in your F-Script console to play with it:
DURATION := 0.5.
WIDTH    := 800.
HEIGHT   := 360.
TOOLBOX_HEIGHT := 64.
NUM_OF_BOXES [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=961&subd=pmougin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Also on <a href="http://web.mac.com/oyasuhisa/Products/F-Script.html">oyasuhisa</a>, a cool demo of animating views into crazy transparent windows, making use of Cocoa&#8217;s animation techniques. (<a href="http://web.mac.com/oyasuhisa/Products/F-Script_files/AnimatingViews.fs.gz">download</a>).</p>
<div style="text-align:center;"><img src="http://pmougin.files.wordpress.com/2009/08/animatingviews1.png?w=482&#038;h=269" alt="AnimatingViews.png" border="0" width="482" height="269" /></div>
<p>I reproduce the code below (slightly modified), so you just have to copy and paste in your F-Script console to play with it:</p>
<pre class="codebox"><code><span class="identifier">DURATION</span> := <span class="literal">0.5</span>.
<span class="identifier">WIDTH</span>    := <span class="literal">800</span>.
<span class="identifier">HEIGHT</span>   := <span class="literal">360</span>.
<span class="identifier">TOOLBOX_HEIGHT</span> := <span class="literal">64</span>.
<span class="identifier">NUM_OF_BOXES</span> := <span class="literal">50</span>.

<span class="identifier">window</span> := <span class="identifier">NSWindow</span> <span class="selector">alloc initWithContentRect:</span>(<span class="identifier">120</span><span class="selector">&lt;&gt;</span><span class="literal">60</span> <span class="selector">extent:</span><span class="identifier">WIDTH</span><span class="selector">&lt;&gt;</span>(<span class="identifier">HEIGHT</span> <span class="selector">+</span> <span class="identifier">TOOLBOX_HEIGHT</span>))
                                   <span class="selector">styleMask:</span><span class="identifier">NSTexturedBackgroundWindowMask</span> <span class="selector">+</span> <span class="identifier">NSTitledWindowMask</span> <span class="selector">+</span> <span class="identifier">NSClosableWindowMask</span>
                                     <span class="selector">backing:</span><span class="identifier">NSBackingStoreBuffered</span>
                                       <span class="selector">defer:</span><span class="literal">NO</span>.
<span class="identifier">window</span> <span class="selector">setOpaque:</span><span class="literal">NO</span>;
       <span class="selector">setBackgroundColor:</span><span class="identifier">NSColor</span> <span class="selector">clearColor</span>;
       <span class="selector">setHasShadow:</span><span class="literal">NO</span>.

<span class="identifier">make_box</span> := [:<span class="identifier">frame</span> |
             | <span class="identifier">box</span> |
             <span class="identifier">box</span> := <span class="identifier">NSBox</span> <span class="selector">alloc</span> <span class="selector">initWithFrame:</span><span class="identifier">frame</span>.
             <span class="identifier">box</span> <span class="selector">setBoxType:</span><span class="identifier">NSBoxCustom</span>;
                 <span class="selector">setBorderType:</span><span class="identifier">NSLineBorder</span>;
                 <span class="selector">setTitlePosition:</span><span class="identifier">NSNoTitle</span>.
             <span class="identifier">box</span>].

<span class="identifier">toolbox</span> := <span class="identifier">make_box</span> <span class="selector">value:</span>(<span class="literal">0</span><span class="selector">&lt;&gt;</span><span class="literal">0</span> <span class="selector">extent:</span><span class="identifier">WIDTH</span><span class="selector">&lt;&gt;</span><span class="identifier">TOOLBOX_HEIGHT</span>).
<span class="identifier">toolbox</span> <span class="selector">setFillColor:</span>(<span class="identifier">NSColor</span> <span class="selector">colorWithCalibratedWhite:</span><span class="literal">0.5</span> <span class="selector">alpha:</span><span class="literal">0.3</span>);
        <span class="selector">setContentViewMargins</span>:(<span class="identifier">NSValue</span> <span class="selector">sizeWithWidth:</span><span class="literal">0</span> <span class="selector">height:</span><span class="literal">0</span>).
<span class="identifier">window</span> <span class="selector">contentView</span> <span class="selector">addSubview:</span><span class="identifier">toolbox</span>.

<span class="identifier">field</span> := <span class="identifier">make_box</span> <span class="selector">value:</span>(0<span class="selector">&lt;&gt;</span><span class="identifier">TOOLBOX_HEIGHT</span> <span class="selector">extent:</span><span class="identifier">WIDTH</span><span class="selector">&lt;&gt;</span><span class="identifier">HEIGHT</span>).
<span class="identifier">field</span> <span class="selector">setFillColor:</span>(<span class="identifier">NSColor</span> <span class="selector">colorWithCalibratedWhite:</span><span class="literal">1.0</span> <span class="selector">alpha:</span><span class="literal">0.1</span>);
      <span class="selector">setContentViewMargins:</span>(<span class="identifier">NSValue</span> <span class="selector">sizeWithWidth:</span><span class="literal">0</span> <span class="selector">height:</span><span class="literal">0</span>).
<span class="identifier">window</span> <span class="selector">contentView addSubview:</span><span class="identifier">field</span>.

<span class="identifier">SIZE</span> := (<span class="identifier">WIDTH</span> <span class="selector">min:</span><span class="identifier">HEIGHT</span>) <span class="selector">/</span> <span class="literal">10</span> <span class="selector">floor</span>.
<span class="identifier">BOX_EXTENT</span> := <span class="identifier">SIZE</span><span class="selector">&lt;&gt;</span><span class="identifier">SIZE</span>.
<span class="identifier">boxes</span> := {}.
<span class="identifier">box_frame</span> := ((<span class="identifier">WIDTH</span> <span class="selector">-</span> <span class="identifier">SIZE</span>)<span class="selector"> / </span><span class="literal">2</span>)<span class="selector">&lt;&gt;</span><span class="identifier">HEIGHT</span> <span class="selector">extent:</span><span class="identifier">BOX_EXTENT</span>.
<span class="identifier">NUM_OF_BOXES</span> <span class="selector">timesRepeat:</span>[<span class="identifier">boxes</span> <span class="selector">addObject:</span>(<span class="identifier">make_box</span> <span class="selector">value:</span><span class="identifier">box_frame</span>)].
<span class="identifier">setFillColors</span> := [<span class="identifier">boxes</span> <span class="selector">setFillColor:</span>(<span class="identifier">NSColor</span> <span class="selector">colorWithCalibratedHue:@</span>(<span class="identifier">boxes</span> <span class="selector">count</span> <span class="selector">iota</span> <span class="selector">/</span> <span class="identifier">boxes</span> <span class="selector">count</span>)
                                                          <span class="selector">saturation:</span><span class="literal">1.0</span>
                                                          <span class="selector">brightness:</span><span class="literal">1.0</span>
                                                               <span class="selector">alpha:</span><span class="literal">0.8</span>)].
<span class="identifier">setFillColors</span> <span class="selector">value</span>.
<span class="identifier">field</span> <span class="selector">addSubview:@</span><span class="identifier">boxes</span>.

<span class="identifier">animationContext</span> := [:<span class="identifier">block</span> :<span class="identifier">duration</span> |
                     <span class="identifier">NSAnimationContext</span> <span class="selector">beginGrouping</span>.
                     <span class="identifier">NSAnimationContext</span> <span class="selector">currentContext</span> <span class="selector">setDuration:</span><span class="identifier">duration</span>.
                     <span class="identifier">block</span> <span class="selector">value</span>.
                     <span class="identifier">NSAnimationContext</span> <span class="selector">endGrouping</span>].

<span class="identifier">rules</span> := {{<span class="string">'left'</span>, <span class="literal">120</span><span class="selector">&lt;&gt;</span><span class="literal">15</span>,
           [:<span class="identifier">count</span> |
            | <span class="identifier">iota</span> <span class="identifier">base</span> |
            <span class="identifier">iota</span> := <span class="identifier">count</span> <span class="selector">iota</span>.
            <span class="identifier">base</span> := (<span class="identifier">HEIGHT</span> <span class="selector">/</span> <span class="identifier">SIZE</span>) <span class="selector">floor</span> <span class="selector">min:</span>(<span class="identifier">count</span> <span class="selector">raisedTo:</span><span class="literal">0.5</span>) <span class="selector">floor</span>.
            (  (           (<span class="identifier">iota</span>   <span class="selector">/</span> <span class="identifier">base</span>) <span class="selector">integerPart</span>     <span class="selector">*</span> <span class="identifier">SIZE</span>)
             <span class="selector">&lt;&gt;</span>(           (<span class="identifier">iota</span> <span class="selector">rem:</span><span class="identifier">base</span>)                 <span class="selector">*</span> <span class="identifier">SIZE</span>))]},
          {<span class="string">'top'</span>, <span class="literal">200</span><span class="selector">&lt;&gt;</span><span class="literal">30</span>,
           [:<span class="selector">count</span> |
            | <span class="identifier">iota</span> <span class="identifier">base</span> |
            <span class="identifier">iota</span> := <span class="identifier">count</span> <span class="selector">iota</span>.
            <span class="identifier">base</span> := (<span class="identifier">WIDTH</span> <span class="selector">/</span> <span class="identifier">SIZE</span>) <span class="identifier">floor</span>.
            (  (           (<span class="identifier">iota</span> <span class="selector">rem:</span><span class="identifier">base</span>)                 <span class="selector">*</span> <span class="identifier">SIZE</span> )
             <span class="selector">&lt;&gt;</span>(<span class="identifier">HEIGHT</span> <span class="selector">- @</span>((<span class="identifier">iota</span>   <span class="selector">/</span> <span class="identifier">base</span>) <span class="selector">integerPart</span> <span class="selector">+</span> <span class="literal">1</span> <span class="selector">*</span> <span class="identifier">SIZE</span>)))]},
          {<span class="string">'bottom'</span>, <span class="literal">200</span><span class="selector">&lt;&gt;</span><span class="literal">0</span>,
           [:<span class="identifier">count</span> |
            | <span class="identifier">iota</span> <span class="identifier">base</span> <span class="identifier">height</span> |
            <span class="identifier">base</span>   := (<span class="identifier">WIDTH</span> <span class="selector">/</span> <span class="identifier">SIZE</span>) <span class="selector">floor</span>.
            <span class="identifier">height</span> := (<span class="identifier">count</span><span class="selector"> / </span><span class="identifier">base</span>) <span class="selector">ceiling</span>.
            <span class="identifier">iota</span> := <span class="identifier">count</span> <span class="selector">iota</span> <span class="selector">+</span> (<span class="identifier">height</span> <span class="selector">*</span> <span class="identifier">base</span> <span class="selector">-</span> <span class="identifier">count</span>).
            <span class="identifier">height</span> := <span class="identifier">height</span> <span class="selector">*</span> <span class="identifier">SIZE</span>.
            (  (<span class="identifier">WIDTH</span>  <span class="selector">- @</span>((<span class="identifier">iota</span> <span class="selector">rem:</span><span class="identifier">base</span>)             <span class="selector">+</span> <span class="literal">1</span> <span class="selector">*</span> <span class="identifier">SIZE</span>))
             <span class="selector">&lt;&gt;</span>(<span class="identifier">height</span> <span class="selector">- @</span>((<span class="identifier">iota</span>   <span class="selector">/</span> <span class="identifier">base</span>) <span class="selector">integerPart</span> <span class="selector">+</span> <span class="literal">1</span> <span class="selector">*</span> <span class="identifier">SIZE</span>)))]},
          {<span class="string">'right'</span> , <span class="literal">280</span><span class="selector">&lt;&gt;</span><span class="literal">15</span>,
           [:<span class="identifier">count</span> |
            | <span class="identifier">iota</span> <span class="identifier">base</span> |
            <span class="identifier">iota</span> := <span class="identifier">count</span> <span class="selector">iota</span>.
            <span class="identifier">base</span> := (<span class="identifier">HEIGHT</span> <span class="selector">/</span> <span class="identifier">SIZE</span>) <span class="selector">floor</span>.
            (  (<span class="identifier">WIDTH</span> <span class="selector">- @</span>((<span class="identifier">iota</span>   <span class="selector">/</span> <span class="identifier">base</span>) <span class="selector">integerPart</span> <span class="selector">+</span> <span class="literal">1</span> <span class="selector">*</span> <span class="identifier">SIZE</span>))
             <span class="selector">&lt;&gt;</span>(          (<span class="identifier">iota</span> <span class="selector">rem:</span><span class="identifier">base</span>)                 <span class="selector">*</span> <span class="identifier">SIZE</span> ))]},
          {<span class="string">'random'</span>, <span class="literal">20</span><span class="selector">&lt;&gt;</span><span class="literal">15</span>,
           [:<span class="identifier">count</span> |
            | <span class="identifier">array</span> |
            <span class="identifier">array</span> := {}.
            <span class="identifier">count</span> <span class="selector">timesRepeat:</span>[<span class="identifier">array</span> <span class="selector">addObject:</span>((<span class="identifier">WIDTH</span> <span class="selector">-</span> <span class="identifier">SIZE</span>) <span class="selector">random</span>)<span class="selector">&lt;&gt;</span>((<span class="identifier">HEIGHT</span> <span class="selector">-</span> <span class="identifier">SIZE</span>) <span class="selector">random</span>)].
            <span class="identifier">array</span>]}}.
<span class="identifier">animate</span> := [:<span class="identifier">make_origins</span> |
            | <span class="identifier">origins</span> <span class="identifier">frames</span> |
            <span class="identifier">origins</span> := <span class="identifier">make_origins</span> <span class="selector">value:</span><span class="identifier">boxes</span> <span class="selector">count</span>.
            <span class="identifier">frames</span>  := <span class="identifier">origins</span> <span class="selector">extent:</span><span class="identifier">BOX_EXTENT</span>.
            <span class="identifier">animationContext</span> <span class="selector">value:</span>[<span class="identifier">boxes</span> <span class="selector">animator</span> <span class="selector">setFrame:</span><span class="identifier">frames</span>]
                             <span class="selector">value:</span><span class="identifier">DURATION</span>].
<span class="identifier">make_targets</span> := [:<span class="identifier">make_origins</span> |
                 [<span class="identifier">last_rule</span> := <span class="identifier">make_origins</span>.
                  <span class="identifier">animate</span> <span class="selector">value:</span><span class="identifier">make_origins</span>]].
<span class="identifier">rules</span><span class="selector">@ at:</span><span class="literal">2</span> <span class="selector">put:@</span>(<span class="identifier">make_targets</span> <span class="selector">value:@</span>(<span class="identifier">rules</span><span class="selector">@ at:</span><span class="literal">2</span>)).

<span class="identifier">removed_box</span> := <span class="literal">nil</span>.
<span class="identifier">REMOVED_BORDER_COLOR</span> := <span class="identifier">NSColor</span> <span class="selector">colorWithCalibratedWhite:</span><span class="literal">0.0</span> <span class="selector">alpha:</span><span class="literal">0.0</span>.
<span class="identifier">rules</span> <span class="selector">addObject:</span>{<span class="string">'add'</span>, (<span class="identifier">WIDTH</span> <span class="selector">-</span> <span class="literal">240</span>)<span class="selector">&lt;&gt;</span><span class="literal">30</span>,
                 [| <span class="identifier">box</span> |
                  <span class="identifier">box</span> := <span class="identifier">make_box</span> <span class="selector">value:</span>((<span class="identifier">WIDTH</span> <span class="selector">-</span> <span class="literal">240</span> <span class="selector">+</span> <span class="literal">40</span>)<span class="selector">&lt;&gt;</span><span class="literal">0</span> <span class="selector">extent:</span><span class="identifier">BOX_EXTENT</span>).
                  <span class="identifier">field</span> <span class="selector">addSubview:</span><span class="identifier">box</span>.
                  <span class="identifier">boxes</span> <span class="selector">addObject:</span><span class="identifier">box</span>.
                  <span class="identifier">animate</span> <span class="selector">value:</span><span class="identifier">last_rule</span>.
                  <span class="identifier">setFillColors</span> <span class="selector">value</span>]};
      <span class="selector">addObject:</span>{<span class="string">'remove'</span>, (<span class="identifier">WIDTH</span> <span class="selector">-</span> <span class="literal">240</span>)<span class="selector">&lt;&gt;</span><span class="literal">0</span>,
                 [| <span class="identifier">count</span> |
                  <span class="identifier">count</span> := <span class="identifier">boxes</span> <span class="selector">count</span>.
                  (<span class="identifier">removed_box</span> <span class="selector">~~</span> <span class="literal">nil</span>)
                  <span class="selector">ifTrue:</span>[<span class="identifier">removed_box</span> <span class="selector">removeFromSuperview</span>.
                          <span class="identifier">removed_box</span> := <span class="literal">nil</span>].
                  (<span class="literal">0</span> <span class="selector">&lt;</span> <span class="identifier">count</span>)
                  <span class="selector">ifTrue:</span>[| <span class="identifier">frame</span> |
                          <span class="identifier">removed_box</span> := <span class="identifier">boxes</span> <span class="selector">at:</span>(<span class="identifier">boxes</span> <span class="selector">count</span> <span class="selector">random</span>).
                          <span class="identifier">removed_box</span> <span class="selector">setBorderColor:</span><span class="identifier">REMOVED_BORDER_COLOR</span>.
                          <span class="identifier">frame</span> := (<span class="identifier">removed_box</span> <span class="selector">frame</span> <span class="selector">origin</span> <span class="selector">x</span>)<span class="selector">&lt;&gt;</span>(<span class="literal">-1</span> <span class="selector">*</span> <span class="identifier">SIZE</span>) <span class="selector">extent:</span><span class="identifier">BOX_EXTENT</span>.
                          <span class="identifier">boxes</span> <span class="selector">removeObject:</span><span class="identifier">removed_box</span>.
                          <span class="identifier">setFillColors</span> <span class="selector">value</span>.
                          <span class="identifier">animate</span> <span class="selector">value:</span><span class="identifier">last_rule</span>.
                          <span class="identifier">animationContext</span> <span class="selector">value:</span>[<span class="identifier">removed_box</span> <span class="selector">animator</span> <span class="selector">setFrame:</span><span class="identifier">frame</span>]
                                           <span class="selector">value:</span><span class="identifier">DURATION</span> <span class="selector">*</span> <span class="literal">2</span>]]}.

<span class="identifier">button_frames</span> := (<span class="identifier">rules</span><span class="selector">@ at:</span><span class="literal">1</span>) <span class="selector">extent:</span><span class="literal">80</span><span class="selector">&lt;&gt;</span><span class="literal">30</span>.
<span class="identifier">buttons</span> := [:<span class="identifier">frame</span> | <span class="identifier">NSButton</span> <span class="selector">alloc</span> <span class="selector">initWithFrame:</span><span class="identifier">frame</span>] <span class="selector">value:@</span><span class="identifier">button_frames</span>.
<span class="identifier">buttons</span> <span class="selector">setTitle:</span>(<span class="identifier">rules</span><span class="selector">@ at:</span><span class="literal">0</span>);
        <span class="selector">setBezelStyle:</span><span class="identifier">NSRoundedBezelStyle</span>;
        <span class="selector">setTarget:</span>(<span class="identifier">rules</span><span class="selector">@ at:</span><span class="literal">2</span>);
        <span class="selector">setAction:</span><span class="literal">#value</span>.
<span class="identifier">toolbox</span> <span class="selector">addSubview:@</span><span class="identifier">buttons</span>.

<span class="identifier">window</span> <span class="selector">orderFront:</span><span class="literal">nil</span>.
((<span class="identifier">rules</span> <span class="selector">at:</span>((<span class="identifier">rules</span><span class="selector">@ at:</span><span class="literal">0</span>) <span class="selector">!</span> <span class="string">'random'</span>)) <span class="selector">at:</span><span class="literal">2</span>) <span class="selector">value</span>. <span class="comment">"Initialize last_rule"</span>
</code></pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/961/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/961/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/961/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/961/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/961/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=961&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2009/08/14/f-script-fun-animating-views/feed/</wfw:commentRss>
		<slash:comments>2</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/08/animatingviews1.png" medium="image">
			<media:title type="html">AnimatingViews.png</media:title>
		</media:content>
	</item>
		<item>
		<title>F-Scripting with Emacs</title>
		<link>http://pmougin.wordpress.com/2009/08/14/f-scripting-with-emacs/</link>
		<comments>http://pmougin.wordpress.com/2009/08/14/f-scripting-with-emacs/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 11:57: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=955</guid>
		<description><![CDATA[Posted on oyasuhisa, a package that integrates F-Script and Emacs (download).
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=955&subd=pmougin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Posted on <a href="http://web.mac.com/oyasuhisa/Products/F-Script.html">oyasuhisa</a>, a package that integrates F-Script and Emacs (<a href="http://web.mac.com/oyasuhisa/Products/F-Script_files/f-script-mode.el.gz">download</a>).</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/955/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/955/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/955/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/955/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/955/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/955/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/955/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/955/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/955/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/955/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=955&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2009/08/14/f-scripting-with-emacs/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>F-Script 2.0 RC1 now available</title>
		<link>http://pmougin.wordpress.com/2009/08/10/f-script-2-0-rc1-now-available/</link>
		<comments>http://pmougin.wordpress.com/2009/08/10/f-script-2-0-rc1-now-available/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 19:54:08 +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=939</guid>
		<description><![CDATA[
F-Script 2.0 Release Candidate 1 is now available for download at http://www.fscript.org/download/F-Script20090809.zip


Enjoy! (and don&#8217;t forget to report issues)
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=939&subd=pmougin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>
F-Script 2.0 Release Candidate 1 is now available for download at <a href="http://www.fscript.org/download/F-Script20090809.zip">http://www.fscript.org/download/F-Script20090809.zip</a>
</p>
<p>
Enjoy! (and don&#8217;t forget to <a href="http://groups.google.com/group/f-script">report</a> issues)</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/939/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/939/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/939/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/939/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/939/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/939/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/939/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/939/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/939/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/939/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=939&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2009/08/10/f-script-2-0-rc1-now-available/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>CocoaHeads Paris this evening (may 27, 2009)</title>
		<link>http://pmougin.wordpress.com/2009/05/26/cocoaheads-paris-this-evening-may-27-2009/</link>
		<comments>http://pmougin.wordpress.com/2009/05/26/cocoaheads-paris-this-evening-may-27-2009/#comments</comments>
		<pubDate>Tue, 26 May 2009 21:23:15 +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=927</guid>
		<description><![CDATA[

A meeting for Cocoa developers in Paris.


Main subjects today:

F-Script
Projet Osculator


Location: La Cantine &#8211; 151 rue Montmartre, Passage des Panoramas
12 Galerie Montmartre, 75002 Paris

More information here.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=927&subd=pmougin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><div style="text-align:left;"><img src="http://pmougin.files.wordpress.com/2009/05/f2495186-f8f3-476e-8c89-0a048fae1720.jpg?w=95" border="0" width="95"></div>
<p>
A meeting for Cocoa developers in Paris.
</p>
<p>
Main subjects today:</p>
<ul>
<li><a href="http://www.fscript.org">F-Script</a></li>
<li><a href="http://www.osculator.net">Projet Osculator</a></li>
</ul>
<p>
Location: La Cantine &#8211; 151 rue Montmartre, Passage des Panoramas<br />
12 Galerie Montmartre, 75002 Paris
</p>
<p>More information <a href="http://cocoaheads.org/fr/Paris/index.html">here</a>.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pmougin.wordpress.com/927/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pmougin.wordpress.com/927/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pmougin.wordpress.com/927/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pmougin.wordpress.com/927/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pmougin.wordpress.com/927/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pmougin.wordpress.com/927/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pmougin.wordpress.com/927/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pmougin.wordpress.com/927/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pmougin.wordpress.com/927/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pmougin.wordpress.com/927/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pmougin.wordpress.com&blog=2047678&post=927&subd=pmougin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://pmougin.wordpress.com/2009/05/26/cocoaheads-paris-this-evening-may-27-2009/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/05/f2495186-f8f3-476e-8c89-0a048fae1720.jpg" medium="image" />
	</item>
	</channel>
</rss>