<?xml version='1.0' encoding='UTF-8' ?>
<rss version="2.0" xml:base="http://www.cincomsmalltalk.com/userblogs/travis/" xmlns:admin="http://webns.net/mvcb/" xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:icbm="http://postneo.com/icbm" xmlns:includedComments="http://www.laudably.com/rss2-comments" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:media="http://search.yahoo.com/mrss/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/">
	<channel>
		<title>Objology</title>
		<link>http://www.cincomsmalltalk.com/userblogs/travis/blogView</link>
		<description>Is this TAG Extra?</description>
		<webMaster>tgriggs@cincom.com</webMaster>
		<lastBuildDate>Fri, 12 Jun 2009 08:53:47 EDT</lastBuildDate>
		<image>
			<url>/images/why-small.png</url>
			<title>Objology</title>
			<link>http://www.cincomsmalltalk.com/userblogs/travis/blogView</link>
			<height>50</height>
			<width>81</width>
		</image>
		<admin:generatorAgent rdf:resource="/CincomSmalltalkWiki/Silt"></admin:generatorAgent>
		<admin:errorReportsTo rdf:resource="mailto:tgriggs@cincom.com"></admin:errorReportsTo>
		<dc:language>en-us</dc:language>
		<dc:creator>Travis Griggs</dc:creator>
		<dc:rights>Copyright 2005-2007 Travis Griggs</dc:rights>
		<dc:date>2009-06-12T08:53:47-04:00</dc:date>
		<icbm:latitude>46.100000</icbm:latitude>
		<icbm:longitude>-118.283333</icbm:longitude>
		<item>
			<title>How Low Can You Go?</title>
			<link>http://www.cincomsmalltalk.com/userblogs/travis/blogView?showComments=true&amp;printTitle=How_Low_Can_You_Go&amp;entry=3421629022</link>
			<category>Cairo</category>
			<pubDate>Fri, 05 Jun 2009 04:30:22 EDT</pubDate>
			<description><![CDATA[<div xmlns="http://www.w3.org/1999/xhtml">
<p>Recently, I had a question regarding running Cairo on VisualWorks 7.4. Is it possible?

<p>

I was curious, so I tied a bunch of balloons to my computer and set out on an adventure to find out. Here's what my journey looked like:

<p>

<ol>

<li>Fire up latest version of 7.7, load NewTextFind, as something to test with.</li>

<li>Look at prereqs, create parcels out of CairoGraphics, Pango, Weaklings, and NewTextFind.</li>

<li>Install 7.4.1 on Vista.</li>

<li>Copy all of the dlls for Cairo/Pango in my 7.7 image directory over to the 7.4.1 one. Copy the 4 .pcl/.pst files over</li>

<li>Fire up 7.4.1</li>

<li>Load Weaklings, Cairo, and Pango parcels</li>

<li>Run a bare bones Cairo test:

<pre>

p := Pixmap extent: 100 @ 100.

p graphicsContext newCairoContextWhile: 

		[:cr | 

		cr

			source: ColorValue purple;

			paint.

		layout := Pango.Layout text: 'Hi'.

		cr

			moveTo: 20 @ 20;

			source: ColorValue cyan.

		layout showOn: cr].

p asImage</pre></li>

<li>Discover that we added the method tag based library specification in 7.6; go look at the various win* methods on LibCairo, LibGDI, and LibPango, and put those values in the class definition libraryFiles: arrays.</li>

<li>Rerun the test. Giggle with delight when it works.</li>

<li>Load NewTextFind parcel.</li>

<li>Hit ctrl-l in a text field to activate it; discover that we also added the message #half in 7.6 (Cairo doesn't use it, just NewTextFind)</li>

<li>Add ArithmeticValue:

<pre>half

	^self / 2

</pre></li>

<li>Chortle and Chuckle again.</li>

<li>Go blog about it.</li>

<p>

The End

<p>

<i>Based on a true story. After discovering that CairoGraphics and Pango bindings for VisualWorks worked on 7.4.1 with minimal effort, Travis was last seen wandering off to bed...</i>


</p></div>]]></description>
			<guid isPermaLink="false">3421629022</guid>
			<pingback:server>http://www.cincomsmalltalk.com/userblogs/travis/servlet/CommentAPIPBServlet?guid=3421629022</pingback:server>
			<pingback:target>http://www.cincomsmalltalk.com/userblogs/travis/blogView?guid=3421629022</pingback:target>
			<includedComments:comment-collection>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=How_Low_Can_You_Go&amp;entry=3421629022</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=How_Low_Can_You_Go&amp;entry=3421629022</includedComments:puid>
					<includedComments:author>Charles Adams</includedComments:author>
					<includedComments:pubDate>2009-06-05T14:23:08-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;That's encouraging news. It is a sad fact that there are projects that will be on 7.4.1 for quite a long time. It is an inescapable reality. The ability to cherry pick great ideas and back-port them is both good and bad. Good because it provides exciting new behaviors; bad because it&amp;nbsp;diminishes the incentive to move forward. Regardless, thank you for running this exercise.&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>Encouraging</includedComments:title>
				</includedComments:comment>
			</includedComments:comment-collection>
			<wfw:comment>http://www.cincomsmalltalk.com/userblogs/travis/servlet/CommentAPIServlet?guid=3421629022</wfw:comment>
		</item>
		<item>
			<title>Arguments about Blocks</title>
			<link>http://www.cincomsmalltalk.com/userblogs/travis/blogView?showComments=true&amp;printTitle=Arguments_about_Blocks&amp;entry=3421406381</link>
			<category>Counting Belly Button Wrinkles</category>
			<pubDate>Tue, 02 Jun 2009 14:39:41 EDT</pubDate>
			<description><![CDATA[<div xmlns="http://www.w3.org/1999/xhtml">
<p>I was discussing with a colleague the types of keywords we surround blocks with. In particular not which message we send to them, but which types of keywords frequently get passed literal blocks as arguments. After we had asserted what we were sure was the "obvious common pattern", my interest was piqued. I sat down and wrote some code.

<p>

First I flirted with ParseTreeSearcher. This seems like an obvious thing. But it's not the right way (IMO) to do this kind of query. The ParseTreeSearcher is about matching relatively simple patterns against source trees. It uses a custom language for specifying the patterns to match.

<p>

Luckily, we're not beholden to use a ProgramNodeVistor just so we can enumerate with code that looks like <i>someExpression ifTrue: [ noteIt ]</i>. ProgramNode responds to nodesDo:. The query, in pseudo code, which I'm interested goes something like this:

<ol>

<li>is it a block?</li>

<li>does the block's argument count match the kinds of blocks I'm looking for (e.g. niladic, etc)?</li>

<li>is the block an argument to a keyword message?</i>

<li>what subpart of the selector preceded the block then?</li>

</ol>

Here's a chunk of code that sweeps my whole development image for that:

<pre>

bag := Bag new.

blockArgCount := 0.

SystemUtils allBehaviorsDo: [:eachBehavior |

    eachBehavior selectorsAndMethodsDo: [:selector :ignored |

      (eachBehavior parseTreeFor: selector)

        ifNotNil: [:tree |

          tree nodesDo: [:each |

          "is it a block?"

          each isBlock

            ifTrue: ["is it the arg count I'm interested in?"

              each arguments size = blockArgCount

                ifTrue: ["is it an argument to a message?"

                  (each parent isMessage and: [each parent receiver ~~ each])

                    ifTrue: ["then record the keyword that preceded it"

                      bag

                        add: (each parent selectorParts at: (each parent arguments indexOf: each)) value]]]]]]].

top15 := ((bag contents associations

      asSortedCollection: [:a :b | a value > b value]) first: 15)

      collect: [:each | each key -> (each value asFloat / bag size)]

</pre>

Here's the results for blocks of argument count 0, 1, and 2.

<h3>0 Arguments</h3>

<table><tbody>

<tr><td><b>Selector</b></td><td><b>Percent</b></td></tr>

<tr><td>ifTrue:</td><td>46.8734</td></tr>

<tr><td>ifFalse:</td><td>28.023</td></tr>

<tr><td>and:</td><td>7.13361</td></tr>

<tr><td>or:</td><td>4.30638</td></tr>

<tr><td>ifAbsent:</td><td>2.50518</td></tr>

<tr><td>ifNil:</td><td>1.08428</td></tr>

<tr><td>whileTrue:</td><td>0.860953</td></tr>

<tr><td>ensure:</td><td>0.825349</td></tr>

<tr><td>ifNone:</td><td>0.792983</td></tr>

<tr><td>whileFalse:</td><td>0.74767</td></tr>

<tr><td>ifAbsentPut:</td><td>0.66999</td></tr>

<tr><td>ifNotNil:</td><td>0.589073</td></tr>

<tr><td>showWhile:</td><td>0.390018</td></tr>

<tr><td>should:</td><td>0.351178</td></tr>

<tr><td>timesRepeat:</td><td>0.309101</td></tr>

</tbody></table>

<h3>1 Argument</h3>

<table><tbody>

<tr><td><b>Selector</b></td><td><b>Percent</b></td></tr>

<tr><td>do:</td><td>56.2116</td></tr>

<tr><td>collect:</td><td>9.81889</td></tr>

<tr><td>select:</td><td>4.85706</td></tr>

<tr><td>ifNotNil:</td><td>3.74195</td></tr>

<tr><td>detect:</td><td>3.52492</td></tr>

<tr><td>anySatisfy:</td><td>1.81111</td></tr>

<tr><td>reject:</td><td>1.55665</td></tr>

<tr><td>ifDefinedDo:</td><td>1.42194</td></tr>

<tr><td>contains:</td><td>0.935489</td></tr>

<tr><td>allSatisfy:</td><td>0.935489</td></tr>

<tr><td>getBlock:</td><td>0.898069</td></tr>

<tr><td>reverseDo:</td><td>0.666068</td></tr>

<tr><td>compute:</td><td>0.51639</td></tr>

<tr><td>allBehaviorsDo:</td><td>0.434067</td></tr>

<tr><td>bindingsDo:</td><td>0.389163</td></tr>

</tbody></table>

<h3>2 Arguments</h3>

<table><tbody>

<tr><td><b>Selector</b></td><td><b>Percent</b></td></tr>

<tr><td>keysAndValuesDo:</td><td>20.0799</td></tr>

<tr><td>do:</td><td>16.7832</td></tr>

<tr><td>into:</td><td>9.99001</td></tr>

<tr><td>asSortedCollection:</td><td>8.84116</td></tr>

<tr><td>putBlock:</td><td>5.74426</td></tr>

<tr><td>put:</td><td>4.74525</td></tr>

<tr><td>selectorsAndMethodsDo:</td><td>3.24675</td></tr>

<tr><td>sortBlock:</td><td>2.74725</td></tr>

<tr><td>onError:</td><td>1.4985</td></tr>

<tr><td>block:</td><td>1.34865</td></tr>

<tr><td>useTempClass:</td><td>1.2987</td></tr>

<tr><td>fold:</td><td>1.14885</td></tr>

<tr><td>visualBlock:</td><td>1.0989</td></tr>

<tr><td>sorted:</td><td>1.04895</td></tr>

<tr><td>filterBlock:</td><td>0.999001</td></tr>

</tbody></table>


</p></div>]]></description>
			<guid isPermaLink="false">3421406381</guid>
			<pingback:server>http://www.cincomsmalltalk.com/userblogs/travis/servlet/CommentAPIPBServlet?guid=3421406381</pingback:server>
			<pingback:target>http://www.cincomsmalltalk.com/userblogs/travis/blogView?guid=3421406381</pingback:target>
			<includedComments:comment-collection>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Arguments_about_Blocks&amp;entry=3421406381</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Arguments_about_Blocks&amp;entry=3421406381</includedComments:puid>
					<includedComments:author>Adrian</includedComments:author>
					<includedComments:pubDate>2009-06-12T08:53:47-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;Love that one!&lt;/p&gt;
&lt;p&gt;Would be interesting to compare these to the same stats for some large application code base. Which custom domain specific "block control flow constructs" will show up?&amp;nbsp;I guess your dev image mainly consists of libraries and development tools, thus #selectorsAndMethodsDo: at 3% is domain specific to the development tools. How high would domain specific block-constructs score for other applications?&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title></includedComments:title>
				</includedComments:comment>
			</includedComments:comment-collection>
			<wfw:comment>http://www.cincomsmalltalk.com/userblogs/travis/servlet/CommentAPIServlet?guid=3421406381</wfw:comment>
		</item>
		<item>
			<title>To State, or Not To State</title>
			<link>http://www.cincomsmalltalk.com/userblogs/travis/blogView?showComments=true&amp;printTitle=To_State,_or_Not_To_State&amp;entry=3421109034</link>
			<category>blathering philosophy</category>
			<pubDate>Sat, 30 May 2009 04:03:54 EDT</pubDate>
			<description><![CDATA[<div xmlns="http://www.w3.org/1999/xhtml">
<p>I love Smalltalk. Have for a long time. Among the things I've come to love about it over the years, is as a model, which encourages binding behavior to data (state). This is a focus of problem solving in computer programming, that works well for many domains. In a universe far far away, where people don't like state, they do the functional thing and avoid it (state).

<p>

In the Smalltalk universe, we don't spend too much time thinking about stateless functions. We're usually in a search for what data, a given behavior belongs to. What is the right receiver? Whose responsibility is this? Like all simulations, this breaks down some times. There are the rare occasions where we make "utility methods". These are methods that can live anywhere. The only state they need is local state (temps and arguments). The reasons for making them are varied, but for whatever reasons, it happens sometimes. It's not always a perfect world.

<p>

Sometimes, if we get enough of these utility functions, we place them on a Class. Maybe there's a logical class that they're related to, maybe we make a new class, to act as a gathering point for these functions. One example of this, in the VisualWorks system, is the SystemUtils class. It's not the greatest example. A healthy percentage of its behavior should probably be moved to the state it truly goes with. But even after carving that all away, we end up with a chunk of utilities that have some value.

<p>

This same approach has affected, over the years, the way I do ExternalInterface subclasses. When I make one, I'm usually creating a flat facade to a reentrant (read: necessarily stateless) C library. The C functions operate on the data I pass to them. Since they're justifiably just utility methods, I treat them the same way as SystemUtils. I put the methods on the class side. Getting to that point, is a history of asking myself "why?" and getting past common idioms/patterns that we like to generally embrace.

<p>

If one doesn't follow this pattern, one has to create an instance of the utility method holder. Code like this:



<pre>

     LibCairo new cairo_clip: handle.

</pre>



At one point, I found myself asking "why do I do this?" Of course, there are the standard answers such as "class behavior outside of instance creation/constants is bad." But at some point, I got past that. I found myself asking "what am I gaining by creating a new instance each and every single time, other than needlessly exercising the allocator/collector and proving I like to type 'new'?" "What makes these never ending stream of new entities differ, one from another?"

<p>

Flummoxed with this situation, I began doing the "cached singleton" thing. You know the drill. Add a class instance variable called default or current. Add an accessor for it; said accessor lazy initializes the variable to the new instance. Now I'm not making an endless stream of objects, all of which differ from each other in no meaningful way, and all which just turn around and die. Now I would write code that looks like:

<pre>

     LibCairo current cairo_clip: handle.

</pre>

<p>

There's an amusing irony to me with this one. I now type more than I used to type ('current' vs just 'new'). And the coolest thing, is that I managed to add state to the equation. It was until then just a big bag of utility functions. But now, by creating a slot to store the singleton instance, and the code to manage it, I've managed to introduce state into the problem. It's almost like, I've done extra work, just to get state into the problem, so I can feel comfortable in my Smalltalk universe where state is so important.

<p>

This led to further application of the "why do I do this?" scalpel. Once I realize that I created an artificial/arbitrary/extra amount of state to manage, I realize that classes are objects too. And I've already got a singleton managed instance of that. Why do this caching, when I could just put the methods right there, just as well? Which brings us around to the following present day application:

<pre>

     LibCairo cairo_clip: handle.

</pre>

It's just a utility method. I type less this way. I write less code to intialize/access singletons this way. And I haven't figured out what I lose yet.



<p>I just finished up converting the last ExternalInterface in CairoGraphics to follow this pattern. I removed an instance variable. Methods which set it. I was able to remove comments describing how they were managed. The code reads more direct now. This is my story of why I do ExternalInterfaces the way I do.
</p></div>]]></description>
			<guid isPermaLink="false">3421109034</guid>
			<pingback:server>http://www.cincomsmalltalk.com/userblogs/travis/servlet/CommentAPIPBServlet?guid=3421109034</pingback:server>
			<pingback:target>http://www.cincomsmalltalk.com/userblogs/travis/blogView?guid=3421109034</pingback:target>
			<includedComments:comment-collection>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=To_State,_or_Not_To_State&amp;entry=3421109034</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=To_State,_or_Not_To_State&amp;entry=3421109034</includedComments:puid>
					<includedComments:author>Alex Schenkman</includedComments:author>
					<includedComments:pubDate>2009-05-30T11:08:38-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;I like your line of reasoning.&lt;/p&gt;
&lt;p&gt;Is there a point in creating singleton instances at all?&amp;nbsp;If the singleton has state (variables), they could be stored as class variables. right?&lt;/p&gt;
&lt;p&gt;To see if I have understood you right, this pattern could be used for both stateless methods and singletons, regardless whether they have state or not.&lt;/p&gt;
&lt;p&gt;Thanks in advance!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>To singleton or not.</includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=To_State,_or_Not_To_State&amp;entry=3421109034</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=To_State,_or_Not_To_State&amp;entry=3421109034</includedComments:puid>
					<includedComments:author>Randal L. Schwartz</includedComments:author>
					<includedComments:pubDate>2009-05-30T13:39:34-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;The problem with singletons is testing. &amp;nbsp;With a "default" class-side instance var that holds the single real instance, you can also safely create other instances of the class to run tests. &amp;nbsp;Without that, you have to create a temporary empty subclass, and then make sure it gets initialized properly. &amp;nbsp;I guess that wouldn't be hard, but it feels a bit unclean.&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>Testing?</includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=To_State,_or_Not_To_State&amp;entry=3421109034</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=To_State,_or_Not_To_State&amp;entry=3421109034</includedComments:puid>
					<includedComments:author>Reinout Heeck</includedComments:author>
					<includedComments:pubDate>2009-06-02T11:36:38-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;You seem to be adding arbritrary methods to the class side which IMO is bad practice because many of the potential names are already in use by the system for meta programming.&lt;/p&gt;
&lt;p&gt;If your library happens to have a one-arg C function named 'name' and you implement it as #name: your IDE will be hosed, similarly for many other selectors that might occur as C function names (#organization, #category:, #removeCategory:, #compilerClass, #decompile:, etc, etc).&lt;/p&gt;
&lt;p&gt;So I guess a better solution to your itch would be to rename your interface class to LibCairoInterface and create a Shared named LibCairo which holds an /instance/ of the interface class. Initilizing the shared just once at load time is trivial ;-)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>Brittleness in method naming</includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=To_State,_or_Not_To_State&amp;entry=3421109034</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=To_State,_or_Not_To_State&amp;entry=3421109034</includedComments:puid>
					<includedComments:author>Travis Griggs</includedComments:author>
					<includedComments:pubDate>2009-06-02T16:29:18-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;Reinout. Why?&lt;/p&gt;
&lt;p&gt;You assert that if I had a name: message.... But I don't. Are there messages in LibCairo that look remotely conflatable with the Metaclass hierarchy? Does one fear name collisions in a different way between a Class and a MetaClass? If I had a name: method... wouldn't that probably imply some sort of state behind the name: method, and therefore render the whole thing a moot point for this discussion?&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>Re: Reinout</includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=To_State,_or_Not_To_State&amp;entry=3421109034</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=To_State,_or_Not_To_State&amp;entry=3421109034</includedComments:puid>
					<includedComments:author>Mike Klein</includedComments:author>
					<includedComments:pubDate>2009-06-03T00:34:12-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;Why not encapsulate the handle and the external interface into a single object?&lt;/p&gt;
&lt;p&gt;then you can just say:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; interface cairo_clip: handle&lt;/p&gt;
&lt;p&gt;Also, you can initialize use the more verbose&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; interface := &lt;span style="white-space: pre;"&gt;LibCairo current&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;get singleton pattern goodness, and not pull your hair out if you want to try&lt;/p&gt;
&lt;p&gt;to use two versions of the cairo lib later.&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>Encapsulation</includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=To_State,_or_Not_To_State&amp;entry=3421109034</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=To_State,_or_Not_To_State&amp;entry=3421109034</includedComments:puid>
					<includedComments:author>Travis Griggs</includedComments:author>
					<includedComments:pubDate>2009-06-03T00:59:21-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;Mike,

&lt;/p&gt;
&lt;p&gt;I'm not sure how your suggestion/comment pertains to the discussion. What I'm noting is that LibCairo current need not access/lazy-instantiate an &lt;i&gt;instance&lt;/i&gt; of an ExternalInterface. LibCairo current could return one of LibCairo1 and LibCairo2. Not instances of them, just the classes themselves. In fact, it could even cache it, if that kind of thing still floated your boat :) The point is that when your object is stateless, it might as well just be a Behavior. At which point, you don't need an instance, you just need an object with behavior. And a class object does that fine, without the need to manage it's lifecycle.&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>Re: Encapsulation</includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=To_State,_or_Not_To_State&amp;entry=3421109034</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=To_State,_or_Not_To_State&amp;entry=3421109034</includedComments:puid>
					<includedComments:author>Reinout Heeck</includedComments:author>
					<includedComments:pubDate>2009-06-04T06:09:11-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;&lt;span style="font-family: verdana; font-size: 13px;"&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p style="line-height: 1.5em; font-weight: normal; margin-top: 0.7em; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"&gt;&lt;span style="font-style: italic;"&gt;Why?&lt;/span&gt;&lt;/p&gt;
&lt;p style="line-height: 1.5em; font-weight: normal; margin-top: 0.7em; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"&gt;In the abstract: because you are adding method names into a name space that is already heavily 'polluted' with meta protocol. Another take would be that a class object already has the responsibilities of managing code and creating instances, adding the responsibility of being a facade to arbritrary dlls is a design smell.&lt;/p&gt;
&lt;p style="line-height: 1.5em; font-weight: normal; margin-top: 0.7em; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="line-height: 1.5em; font-weight: normal; margin-top: 0.7em; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"&gt;&lt;span style="font-style: italic;"&gt;You assert that if I had a name: message.... But I don't.&amp;nbsp;Are there messages in LibCairo that look remotely conflatable with the Metaclass hierarchy?&lt;/span&gt;&lt;/p&gt;
&lt;p style="line-height: 1.5em; font-weight: normal; margin-top: 0.7em; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"&gt;Are we discussing stateless singletons in general or just libcairo? In the former case I am relaying my experience: been there, done that, backed out of it every time. In the latter case you happen to have no such names yet because you haven't taken your itch to its logical conclusion: if you dislike reading the repetition of 'new' or 'current' the day is nigh that you dislike reading the repetitious 'cairo_' prefix on the method names and will be stripping that too ;-)&lt;/p&gt;
&lt;p style="line-height: 1.5em; font-weight: normal; margin-top: 0.7em; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="line-height: 1.5em; font-weight: normal; margin-top: 0.7em; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"&gt;&lt;span style="font-style: italic;"&gt;&amp;nbsp;Does one fear name collisions in a different way between a Class and a MetaClass?&lt;/span&gt;&lt;/p&gt;
&lt;p style="line-height: 1.5em; font-weight: normal; margin-top: 0.7em; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"&gt;Interesting question - how does one do metaclass programming from the browser? I guess that does not happen much other than by extending the behavior of Behavior. So I guess the answer depends on how much one fears extending MetaClass or Behavior relative to extending class side behavior.&lt;/p&gt;
&lt;p style="line-height: 1.5em; font-weight: normal; margin-top: 0.7em; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"&gt;&lt;span style="font-style: italic;"&gt;If I had a name: method... wouldn't that probably imply some sort of state behind the name: method, and therefore render the whole thing a moot point for this discussion?&lt;/span&gt;&lt;/p&gt;
&lt;p style="line-height: 1.5em; font-weight: normal; margin-top: 0.7em; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"&gt;Not in the context of foreign functions where #name: could be a getter (extract the name of some opaque data dished out earlier by a dll).&lt;/p&gt;
&lt;p style="line-height: 1.5em; font-weight: normal; margin-top: 0.7em; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="line-height: 1.5em; font-weight: normal; margin-top: 0.7em; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"&gt;Anyway: I advise to stick yer stateles singleton instance in a shared variable and avoid resorting to abusing a class for its singleton-ness. If your singleton's behavior happens to be defined in a larger domain hierarchy you get all the other OO goodness like for instance inheritance of protocol extensions too ;-)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>Re: Brittleness in method naming</includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=To_State,_or_Not_To_State&amp;entry=3421109034</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=To_State,_or_Not_To_State&amp;entry=3421109034</includedComments:puid>
					<includedComments:author>
anonymous</includedComments:author>
					<includedComments:pubDate>2009-06-04T07:47:26-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;Comment by 
anonymous&lt;/p&gt;

&lt;p&gt;


&lt;p&gt;I think this could qualify as YAGNI. Clearly, Travis doesn't think he needs any of that yet. If and when he does, it would be trivial to refactor it back. I'm not sure why this is so controversial. To quote the guy I learned Smalltalk from: &amp;quot;Why do you care?&amp;quot; (and I don't mean that with disrespect).&lt;/p&gt;
&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>
Re: To State, or Not To State</includedComments:title>
				</includedComments:comment>
			</includedComments:comment-collection>
			<wfw:comment>http://www.cincomsmalltalk.com/userblogs/travis/servlet/CommentAPIServlet?guid=3421109034</wfw:comment>
		</item>
		<item>
			<title>Mutating your Process, for Instance</title>
			<link>http://www.cincomsmalltalk.com/userblogs/travis/blogView?showComments=true&amp;printTitle=Mutating_your_Process,_for_Instance&amp;entry=3421076502</link>
			<category>SuperPower Lessons?</category>
			<pubDate>Fri, 29 May 2009 19:01:42 EDT</pubDate>
			<description><![CDATA[<div xmlns="http://www.w3.org/1999/xhtml">
<p><a href="http://www.mirandabanda.org/cogblog/">Eliot Miranda</a> writes a great and lengthy dissertation about the <a href="http://www.mirandabanda.org/cogblog/2009/01/14/under-cover-contexts-and-the-big-frame-up/">value of first class contexts</a>. This is a recurring theme in Smalltalk. It's that everything is objects, all the way down, at least to a depth not found in peer OO languages. It's not just the contexts either.

<p>

This post shows how we do instance mutants in Smalltalk, and yet another example of first class everything.

<p>

I had a hard test to write the other day. It involved two processes and potential race condition involving interruptWith: and terminate, both Process APIs. It was meant to test some code that looked, simplified, like:

<p>

<pre>

	watchedProcess := Processor activeProcess.

	alarm :=  [aDuration wait. watchedProcess interruptWith: ["something happens"]] forkAt: watchedProcess priority + 1.

	["do some stuff] ensure: [alarm terminate]

</pre>

The problem was that I needed/wanted to emulate reliably the rare case where <i>watchedProcess</i> was finished, but there was enough life left in <i>alarm</i> to still do the interrupt block. What I needed, for the duration of just this test, was for <i>alarm terminate</i> to not happen.

<p>

Smalltalk behaviors are just first class method dictionaries. Every object's class is one. These are usually ClassDescription objects, found through the normal directed graph of classes you see in your browser. But they don't need to be. Consider the following example:

<pre>

| p |

p := 4 @ 3.

p negated

</pre>

This produces the result of (-4 @ -3). But what if I wanted for some absurd reason to change Point behavior, not for the whole system, because likely things would come crashing down pretty fast, but just for that instance, for a bit. We could modify the code to read:

<pre>

p := 4 @ 3.

p changeClassTo: (p class copy superclass: p class).

p class methodDictionary at: #negated put: (p class methodDictionary at: #transpose).

p negated

</pre>

Now it returns (3@4) instead of the negated value. Just that instance. No other Point in the system will behave that way. Just the mutant one I made. What's going on? The first new line added, is how create a mutant instance. A copy is created of it's defining class, that copy is made a lightweight subclass of the original Point class we know about. We say it's lightweight because, Point doesn't know it as a subclass, so it won't show up in the system tools. And we change the instance class to be this no anonymous copy. 

<p>

The third line, is then free to modify the new anonymous behavior, which it does by mucking with the methodDictionary directly, replacing the #negated method with the #transpose one.

<p>

Other than raising the hackles of the security minded, what, if anything is this good for? It can be handy for instrumenting things to discover behavior. It can be handy for temporarily "fudging" or "faking" a computation, for testing purposes, or other other code discovery. In the case of my test, it was handy for causing my <i>alarm</i> process behave a little differently than processes normally do, thus allowing me to reliably create what was otherwise a rare luck of the roll to get the timing right.

<p>

I was able to modify my test to read something like:

<pre>

thatProcess := self codeToFindThatOneInstance.

thatProcess changeClassTo: (thatProcess class copy superclass: thatProcess class).

thatProcess class compile: 'terminate "do nothing"'.

....

</pre>

Using this technique, I was able to force a process under test to take up some mutant behavior to cause the tested scenario to recur reliably. Because not only are contexts real objects, and classes first class objects, but so too are the very Processes themselves.
</p></div>]]></description>
			<guid isPermaLink="false">3421076502</guid>
			<pingback:server>http://www.cincomsmalltalk.com/userblogs/travis/servlet/CommentAPIPBServlet?guid=3421076502</pingback:server>
			<pingback:target>http://www.cincomsmalltalk.com/userblogs/travis/blogView?guid=3421076502</pingback:target>
			<includedComments:comment-collection>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Mutating_your_Process,_for_Instance&amp;entry=3421076502</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Mutating_your_Process,_for_Instance&amp;entry=3421076502</includedComments:puid>
					<includedComments:author>Hentai</includedComments:author>
					<includedComments:pubDate>2009-05-30T13:22:19-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;That was great. &amp;nbsp;A wonderful explanation of Smalltalk's malleability and highly adaptive nature. One can easily mock objects using this technique for testing and debugging. Thank you for writing this. &amp;nbsp;Please present more ideas like this!&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>Wonderful post</includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Mutating_your_Process,_for_Instance&amp;entry=3421076502</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Mutating_your_Process,_for_Instance&amp;entry=3421076502</includedComments:puid>
					<includedComments:author>
Terry</includedComments:author>
					<includedComments:pubDate>2009-05-30T16:35:45-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;Comment by 
Terry&lt;/p&gt;

&lt;p&gt;


&lt;p&gt;&amp;quot;p class copy superclass: p class&amp;quot; is asking for trouble with instance variables definition.&lt;/p&gt;
&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>
Re: Mutating your Process, for Instance</includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Mutating_your_Process,_for_Instance&amp;entry=3421076502</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Mutating_your_Process,_for_Instance&amp;entry=3421076502</includedComments:puid>
					<includedComments:author></includedComments:author>
					<includedComments:pubDate>2009-05-30T19:37:38-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;Travis,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Great article.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The Ruby community often looks to Smalltalk for the source of ideas in Ruby. &amp;nbsp;I just wrote an article contrasting two aspects of Smalltalk and Ruby &amp;nbsp;http://talklikeaduck.denhaven2.com/2009/05/30/singleton-methods-in-smalltalk-and-ruby prompted by this article.&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>A Smalltalker turned Rubyist's View</includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Mutating_your_Process,_for_Instance&amp;entry=3421076502</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Mutating_your_Process,_for_Instance&amp;entry=3421076502</includedComments:puid>
					<includedComments:author>Randal L. Schwartz</includedComments:author>
					<includedComments:pubDate>2009-05-30T20:24:39-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;p changeClassTo: (p class copy)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;should have sufficed. &amp;nbsp;Leave the common superclass, so it becomes a sister class, not a child class.&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>Yeah, no need for that superclass</includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Mutating_your_Process,_for_Instance&amp;entry=3421076502</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Mutating_your_Process,_for_Instance&amp;entry=3421076502</includedComments:puid>
					<includedComments:author>Adam Spitz</includedComments:author>
					<includedComments:pubDate>2009-05-30T22:29:47-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;
&lt;p&gt;&lt;span style="font-family: Times; font-size: 16px;"&gt;
&lt;div style="background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: #ffffff; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; background-position: initial initial; margin: 8px;"&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;How hard would it be to enhance Inspectors to make it easy to create and see and edit these methods? (Right-click the inspector, choose the "add method" menu item, and type in the code the code for the new method. That sort of thing.)&lt;/p&gt;
&lt;p&gt;(Or do Inspectors already do this? It's been a while since I used any Smalltalk other than &lt;a href="http://selflanguage.org" title="Self"&gt;Self&lt;/a&gt;. But my memory seems to think that Inspectors only showed instance variables, not methods.)&lt;/p&gt;
&lt;p&gt;Of course, once you can program inside inspectors, it's easy to start wondering why you don't just abandon the class browser and forget about classes entirely... ;)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title></includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Mutating_your_Process,_for_Instance&amp;entry=3421076502</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Mutating_your_Process,_for_Instance&amp;entry=3421076502</includedComments:puid>
					<includedComments:author>Travis Griggs</includedComments:author>
					<includedComments:pubDate>2009-05-31T02:47:43-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;Adam, check out the movie in the &lt;a href="http://www.cincomsmalltalk.com/userblogs/travis/blogView?showComments=true&amp;printTitle=Inspecting&lt;u&gt;IEEE&lt;/u&gt;754&amp;entry=3420157815"&gt;previous blog entery&lt;/a&gt;. Jump to about 60% of the way through to get to a pointer where we show exactly that feature, being used to learn more and more about Floating Point representation.&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>Re: Adam Spitz</includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Mutating_your_Process,_for_Instance&amp;entry=3421076502</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Mutating_your_Process,_for_Instance&amp;entry=3421076502</includedComments:puid>
					<includedComments:author>Travis Griggs</includedComments:author>
					<includedComments:pubDate>2009-05-31T02:52:09-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;Randal, I admit to doing this out of pure habit/practice (there's an irony not at all lost on me, that in the next blog post, I'm talking about learning when our "preferred Smalltalk patterns" may not apply, and it's ok to embrace something different).&lt;/p&gt;
&lt;p&gt;There's pros and cons both ways. If you don't do the superclass trick, then any new behavior that might be added, would not be available to your mutant instance. Indeed, in my specific case, it's not important either way. Just do it that way out of habbit. To really make it mutant, in fact, we'd chuck the mutant's method dictionary completely, so that not only an additions, but also any removals would be visible to the mutant. OTOH, you might really want a sibling mutant.&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>Re: Randal Schwarz</includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Mutating_your_Process,_for_Instance&amp;entry=3421076502</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Mutating_your_Process,_for_Instance&amp;entry=3421076502</includedComments:puid>
					<includedComments:author>Adam Spitz</includedComments:author>
					<includedComments:pubDate>2009-06-01T16:12:39-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;
&lt;p&gt;That's great. :) Are there people who actually use that facility and spend all their time programming inside Inspectors, rather than using the regular class browsers?&lt;/p&gt;
&lt;p&gt;I've never actually worked in a system that supported both styles - Self doesn't have anything like a "class browser", and if I remember correctly, Squeak (which is the Smalltalk I'm most familiar with) doesn't really have Inspectors that can do this kind of thing. So I'm very curious about which style people find more natural, when they work in a system that has both available.&lt;/p&gt;
&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title></includedComments:title>
				</includedComments:comment>
			</includedComments:comment-collection>
			<wfw:comment>http://www.cincomsmalltalk.com/userblogs/travis/servlet/CommentAPIServlet?guid=3421076502</wfw:comment>
		</item>
		<item>
			<title>Inspecting IEEE 754</title>
			<link>http://www.cincomsmalltalk.com/userblogs/travis/blogView?showComments=true&amp;printTitle=Inspecting_IEEE_754&amp;entry=3420157815</link>
			<category>More Movies</category>
			<pubDate>Tue, 19 May 2009 03:50:15 EDT</pubDate>
			<description><![CDATA[<div xmlns="http://www.w3.org/1999/xhtml">
<p>

Recently, I had a chance to play with the inspector, floating point numbers, and relearn how computers model them. I made a movie summarizing the experience, showcasing how one can explore floating point values with the Smalltalk inspector.

<p>

<embed src="/casts/travis/IEEE754Inspector.mov" width="1001" height="800"  autoplay=false controller=true loop=false pluginspage="http://www.apple.com/quicktime/">

</embed>

<p>
</p></div>]]></description>
			<guid isPermaLink="false">3420157815</guid>
			<pingback:server>http://www.cincomsmalltalk.com/userblogs/travis/servlet/CommentAPIPBServlet?guid=3420157815</pingback:server>
			<pingback:target>http://www.cincomsmalltalk.com/userblogs/travis/blogView?guid=3420157815</pingback:target>
			<includedComments:comment-collection>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Inspecting_IEEE_754&amp;entry=3420157815</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Inspecting_IEEE_754&amp;entry=3420157815</includedComments:puid>
					<includedComments:author>Bob Westergaard</includedComments:author>
					<includedComments:pubDate>2009-05-20T19:33:03-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;I can see that being a very useful demonstation to someone.&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>That was cool!</includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Inspecting_IEEE_754&amp;entry=3420157815</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Inspecting_IEEE_754&amp;entry=3420157815</includedComments:puid>
					<includedComments:author>Norbert Hartl</includedComments:author>
					<includedComments:pubDate>2009-05-21T04:30:35-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;I really enjoyed the video. I myself see the question about equality often raised on different places. But I never figured it out myself. Now I know, thanks.&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>Very helpful explanation</includedComments:title>
				</includedComments:comment>
			</includedComments:comment-collection>
			<wfw:comment>http://www.cincomsmalltalk.com/userblogs/travis/servlet/CommentAPIServlet?guid=3420157815</wfw:comment>
		</item>
		<item>
			<title>Not your Father's New Prerequisite Engine</title>
			<link>http://www.cincomsmalltalk.com/userblogs/travis/blogView?showComments=true&amp;printTitle=Not_your_Fathers_New_Prerequisite_Engine&amp;entry=3418939103</link>
			<category>General</category>
			<pubDate>Tue, 05 May 2009 01:18:23 EDT</pubDate>
			<description><![CDATA[<div xmlns="http://www.w3.org/1999/xhtml">
<p>A while back, I set out to integrate the NewPrerequisiteEngine add on. That work has now been integrated into the latest build of VisualWorks (7.7 may09.1). It ended up being a bit more than a "file in and include in build." The new engine is faster, but more thorough at the same time. The biggest change, is a complete rewrite of the UI. Here's a movie I put together using <a href="http://www.araelium.com/screenflick/">Screenflick</a> and iMovie. Sorry for the poor audio transitions with my voice, I didn't give enough lead in time with the individual screencasts. And I have the sniffles because it's allergy season here.

<p>

<embed src="/casts/travis/PrereqUI.mov" width="768" height="596"  autoplay=false controller=true loop=false pluginspage="http://www.apple.com/quicktime/">

</embed>

<p>

All of the widgets (except the scrollbar) follow the development arc of using no Controller objects, and dynamic layouts supported by Panel objects. And no Wrappers.
</p></div>]]></description>
			<guid isPermaLink="false">3418939103</guid>
			<pingback:server>http://www.cincomsmalltalk.com/userblogs/travis/servlet/CommentAPIPBServlet?guid=3418939103</pingback:server>
			<pingback:target>http://www.cincomsmalltalk.com/userblogs/travis/blogView?guid=3418939103</pingback:target>
			<includedComments:comment-collection>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Not_your_Fathers_New_Prerequisite_Engine&amp;entry=3418939103</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Not_your_Fathers_New_Prerequisite_Engine&amp;entry=3418939103</includedComments:puid>
					<includedComments:author></includedComments:author>
					<includedComments:pubDate>2009-05-05T05:44:15-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;You said:&lt;/p&gt;
&lt;p&gt;All of the widgets (except the scrollbar) follow the development arc of
using no Controller objects, and dynamic layouts supported by Panel
objects. And no Wrappers.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you elaborate on this a bit?&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>Widgetry?</includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Not_your_Fathers_New_Prerequisite_Engine&amp;entry=3418939103</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Not_your_Fathers_New_Prerequisite_Engine&amp;entry=3418939103</includedComments:puid>
					<includedComments:author>Claus</includedComments:author>
					<includedComments:pubDate>2009-05-05T08:06:08-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;Good music btw.&lt;/p&gt;
&lt;p&gt;A question out of curiousity:&lt;/p&gt;
&lt;p&gt;How are the prerequesites computed? How do you fill the list with object references without a type inference system? Unique message sends are rather easy (theoretically), if the method does only exist in one class, what do you do with two methods being implemented in two classes? Are both prerequisites then?&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title></includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Not_your_Fathers_New_Prerequisite_Engine&amp;entry=3418939103</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Not_your_Fathers_New_Prerequisite_Engine&amp;entry=3418939103</includedComments:puid>
					<includedComments:author>Travis Griggs</includedComments:author>
					<includedComments:pubDate>2009-05-05T11:03:35-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;The prereq engine uses no type inferencer. What is meant by "object refences" is code that specifies a class or namespace directly.

&lt;/p&gt;
&lt;p&gt;In practice it works really pretty well. If anything, 95% of the time, it is not that it is missing stuff, but that people are surprised by what it DOES find. Like even a type inferencer, it's just a set of heuristics that work pretty well.

&lt;/p&gt;
&lt;p&gt;Unique message sends are perhaps better termed "Uniquely packaged message signatures." It doesn't matter if 35 classes implement the same unique selector, IF they all are implemented the same package, then we can determine that your call site needs that package. This means that if you have a method like with: on your your framework, and your code component calls that, we're not going to find that dependency. But in practice, in addition to that with: message, there WILL be some other selector defined by your package that is unique and will cement the dependency that way.

&lt;/p&gt;
&lt;p&gt;The prereq engine is smart enough to NOT create dependencies to literal BindingReferences (e.g. #{Core.Object}). Furthermore, it nullifies the unique message selector for any unique selectors that would tie it to Core.Object for that call site. So you can safely have code that looks like:
&lt;/p&gt;&lt;pre&gt;
#{Foo.Bar} ifDefinedDo: [:theClass | theClass uniqueSelector]
&lt;/pre&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>Re: Curiosity</includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Not_your_Fathers_New_Prerequisite_Engine&amp;entry=3418939103</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Not_your_Fathers_New_Prerequisite_Engine&amp;entry=3418939103</includedComments:puid>
					<includedComments:author>
Terry</includedComments:author>
					<includedComments:pubDate>2009-05-05T11:19:53-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;Comment by 
Terry&lt;/p&gt;

&lt;p&gt;


&lt;p&gt;One consideration I have encountered is the need to separate load prereqs from runtime prereqs. Doing so makes it easier to determine a load sequence for complex package interdependencies. As I recall, if you had this in your GLORP circular dependency example you would find that the load prereqs do not have a circular dependency. So, it would be quite helpful if your engine had a setting that would direct it to consider just the load dependencies or both(as it does now).&lt;/p&gt;
&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>
Re: Not your Father's New Prerequisite Engine</includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Not_your_Fathers_New_Prerequisite_Engine&amp;entry=3418939103</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Not_your_Fathers_New_Prerequisite_Engine&amp;entry=3418939103</includedComments:puid>
					<includedComments:author>Henry</includedComments:author>
					<includedComments:pubDate>2009-05-05T11:23:16-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;One point was somewhat unclear to me...&lt;/p&gt;
&lt;p&gt;Does the new Store make use of the functional package property when loading?&lt;/p&gt;
&lt;p&gt;Or is it still neccessary to a &amp;nbsp;edit and validate the load order of a bundle to make sure it successfully loads?&lt;/p&gt;
&lt;p&gt;Sorting of an existing &amp;Uuml;berpackage so it would successful load from store was my first job-task in Smalltalk, can't say I look back to it with much joy ;)&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title></includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Not_your_Fathers_New_Prerequisite_Engine&amp;entry=3418939103</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Not_your_Fathers_New_Prerequisite_Engine&amp;entry=3418939103</includedComments:puid>
					<includedComments:author>SteveW</includedComments:author>
					<includedComments:pubDate>2009-05-05T11:58:50-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;Maybe after working with this new prereq engine this would be clear.... In your demonstration I didn't see how one would specify a specific version of a package or bundle.&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>how to explicitly set a version for a prereq</includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Not_your_Fathers_New_Prerequisite_Engine&amp;entry=3418939103</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Not_your_Fathers_New_Prerequisite_Engine&amp;entry=3418939103</includedComments:puid>
					<includedComments:author>Travis Griggs</includedComments:author>
					<includedComments:pubDate>2009-05-05T13:06:42-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;Terry,

&lt;/p&gt;
&lt;p&gt;I don't know if you watched the Store Only/Parcel Only segment (starts about half way through), the ability to manage both streams is still there. Neither Glorp nor GlorpVWPort has any unsynchronized prerequisites at the moment.&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>Cyclic Prereqs and Store Only/Parcel Only</includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Not_your_Fathers_New_Prerequisite_Engine&amp;entry=3418939103</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Not_your_Fathers_New_Prerequisite_Engine&amp;entry=3418939103</includedComments:puid>
					<includedComments:author>
Terry</includedComments:author>
					<includedComments:pubDate>2009-05-05T14:40:53-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;Comment by 
Terry&lt;/p&gt;

&lt;p&gt;


&lt;p&gt; Travis&lt;/p&gt;&lt;p&gt;I noticed that the glorp prereq icon indicated a circularity. I also noticed it was not because of a load prereq, i.e. a required superclass. I do not recall what was actually used.&lt;/p&gt;
&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>
Glorp circular prereq</includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Not_your_Fathers_New_Prerequisite_Engine&amp;entry=3418939103</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Not_your_Fathers_New_Prerequisite_Engine&amp;entry=3418939103</includedComments:puid>
					<includedComments:author>Claus</includedComments:author>
					<includedComments:pubDate>2009-05-06T05:50:08-04:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;So what heuristics do you use for stuff like that? My guess would scanning the methods and hoping to stumble over a class method or two in order to find a class.&lt;/p&gt;
&lt;p&gt;Is there documentation about this, or other stuff for heuristics of that kind? That would at least make an interesting read to me :)&lt;/p&gt;
&lt;p&gt;In general, this sounds like a fabulous tool.&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title></includedComments:title>
				</includedComments:comment>
			</includedComments:comment-collection>
			<wfw:comment>http://www.cincomsmalltalk.com/userblogs/travis/servlet/CommentAPIServlet?guid=3418939103</wfw:comment>
		</item>
		<item>
			<title>Switching Safari 4 Firefox</title>
			<link>http://www.cincomsmalltalk.com/userblogs/travis/blogView?showComments=true&amp;printTitle=Switching_Safari_4_Firefox&amp;entry=3413984856</link>
			<category>Off Topic</category>
			<pubDate>Sun, 08 Mar 2009 17:07:36 EST</pubDate>
			<description><![CDATA[<div xmlns="http://www.w3.org/1999/xhtml">
<p>Generally I use Safari for most web browsing. It was/is the "native" web app on OSX after all. It feels like it "fits in" best. Occasionally, I use Firefox for a couple of web sites that don't work as well with Firefox (like writing this blog).

<p>

No more.

<p>

I tried the <a href="http://www.apple.com/safari/download/">Safari 4 beta preview</a> for about a week now. I hate it. So, I've made the switch.

<p>

I don't notice the speed either way. What I do notice is the screwy tab/title bar thing. I do lots of tabs in my browsing. I think the <a href="">guys over at OSNews</a> <a href="http://www.newmobilecomputing.com/story/21056/Safari_4_Beta_UI_Disaster">got it just about right</a>:

<blockquote>

This is where it goes wrong for Safari 4. There, the tabs are the titlebar, leading to a rather schizophrenic UI widget: it has to act as a titlebar and a tab bar, and consequently, does neither of the two very well. Since you have to be able to drag the window via this new tabtitlebar widget, Apple had to create a special and small handle for moving tabs, while making the tabs themselves the place to drag the window. This design decision is something I expect from a 6 year old who writes his fist tabbed text editor - not from a company that prides itself on UI design. 

</blockquote>

<p>

I've noticed this over and over again in the last week. I'll have Skype up and safari up. Safari's in the background. Someone sends me a link in my Skype chat. I click on it. The Safari window is party obscured by the Skype window, but I know that it has dutifully opened a new tab at the end with that content, in fact, I can see part of it loading. So I go to bring the Safari window forward, I don't get the click quite right on Safari window used-to-be-just-a-titlebar-thing and ta-da! instad of just raising the window, it flips to some other tab.

<p>

I found <a href="http://arstechnica.com/apple/news/2009/03/last-years-pwn2own-winner-says-safari-will-be-first-to-fall.ars">this tidbit about Safari vulnerabilities</a> a bit disturbing as well.
</p></div>]]></description>
			<guid isPermaLink="false">3413984856</guid>
			<pingback:server>http://www.cincomsmalltalk.com/userblogs/travis/servlet/CommentAPIPBServlet?guid=3413984856</pingback:server>
			<pingback:target>http://www.cincomsmalltalk.com/userblogs/travis/blogView?guid=3413984856</pingback:target>
			<includedComments:comment-collection>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Switching_Safari_4_Firefox&amp;entry=3413984856</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Switching_Safari_4_Firefox&amp;entry=3413984856</includedComments:puid>
					<includedComments:author>Karsten</includedComments:author>
					<includedComments:pubDate>2009-03-08T18:00:00-05:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;I've tried the Safari 4 as well and after not even some hours of hating the new tabs and most of the other stuff, i've googeled and found a blog where they described some hidden settings. with these safari feels like version 3 again, except that it's a bit faster and slightly crashier.&amp;nbsp;just yesterday i've seen an app on MacUpdate that allows for changing these settings for Safari4 easily:&amp;nbsp;http://www.macupdate.com/info.php/id/30628/safari-4-buddy&lt;/p&gt;
&lt;p&gt;i use Firefox on windows all the time...it's a pretty decent windows app... but i just can't stand it on my mac.. there's no auto-spell checking and lots of other things that you have in every single cocoa application but that are just not there in Firefox (or thunderbird/postbox)... it just doesn't fit into os x, which is the one big reason why i will probably never use firefox as my default browser. that and the shortcuts for the bookmark-bar bookmarks, which is another killerfeature of Safari :-D&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title></includedComments:title>
				</includedComments:comment>
			</includedComments:comment-collection>
			<wfw:comment>http://www.cincomsmalltalk.com/userblogs/travis/servlet/CommentAPIServlet?guid=3413984856</wfw:comment>
		</item>
		<item>
			<title>Resourceful Platform Specific Testing</title>
			<link>http://www.cincomsmalltalk.com/userblogs/travis/blogView?showComments=true&amp;printTitle=Resourceful_Platform_Specific_Testing&amp;entry=3413240159</link>
			<category>SUnitToo</category>
			<pubDate>Sat, 28 Feb 2009 02:15:59 EST</pubDate>
			<description><![CDATA[<div xmlns="http://www.w3.org/1999/xhtml">
<p>TestResources aren't something I've done much with. Recently, <a href="http://www.cincomsmalltalk.com/userblogs/travis/blogView?showComments=true&printTitle=New_SUnitToo_Version&entry=3402927712">I did an update to SUnitToo TestResources</a> to support them better. I hadn't done anything to the SUnitToo(ls) runner though, it still just raised an exception. Today, I fixed that. It handles TestResourceUnavailable exceptions much cleaner now (prints nice message, resets icon status); latest versions published in the Open/Public Repository.

<p>

I did this, because I wanted to try a simple experiment. I'm very loathe to add more thin API points on SUnitToo. When a feature comes up, I'd rather explore ways of putting the basics together, rather than fatten the API.

<p>

One such request that's been kicked around here at Cincom, is platform specific filters. We have a large suite of tests; a small subset of them really are platform specific. Sometimes people put preambles to their tests:

<blockquote>

<pre>

('*MacOSX' match: OSHandle currentPlatformID) ifFalse: [^self]

</pre></blockquote>

But this gets old, and you have to go look them up each time.

<p>

So I experimented with using TestResources to do this task. It turned out to be amazingly simple. Let's say I need to filter some graphics tests that are X11 specific, Windows specific, and MacOSX specific. I create three subclasses of TestResource named X11Only, MacOSXOnly, and WindowsOnly. I add one method to each.

<blockquote>

<pre>

isAvailable

	^Screen default platformName = 'X11'

</pre></blockquote>

<blockquote>

<pre>

isAvailable

	^Screen default platformName = 'MacOSX'

</pre></blockquote>

<blockquote>

<pre>

isAvailable

	^Screen default platformName = 'MS-Windows'

</pre></blockquote>

<p>

Now I can use these as resources for my tests that are platform specific. If they're not there, the tests will be skipped. SUnitToo actually can specify resources at the per test level, so you don't have to devolve to having special concrete test classes, inheriting off of abstract classes or anything like that. An X11 specific graphic test might look something like:

<blockquote>

<pre>

x11SpecificGraphicsText

	&lt;test&gt;

	&lt;uses: #{X11Only}&gt;



	self deny: 'blah' , blah' = 'yadayada'

</pre></blockquote>
</p></div>]]></description>
			<guid isPermaLink="false">3413240159</guid>
			<pingback:server>http://www.cincomsmalltalk.com/userblogs/travis/servlet/CommentAPIPBServlet?guid=3413240159</pingback:server>
			<pingback:target>http://www.cincomsmalltalk.com/userblogs/travis/blogView?guid=3413240159</pingback:target>
			<includedComments:comment-collection>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Resourceful_Platform_Specific_Testing&amp;entry=3413240159</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Resourceful_Platform_Specific_Testing&amp;entry=3413240159</includedComments:puid>
					<includedComments:author>Torsten</includedComments:author>
					<includedComments:pubDate>2009-02-28T08:15:03-05:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;Just wondering that one can ask the "screen" what OS platform it is.&lt;/p&gt;
&lt;p&gt;Wouldnt it be better to have something like "OS current name" ;)&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>Screen and Platform</includedComments:title>
				</includedComments:comment>
				<includedComments:comment>
					<includedComments:guid>blogView?showComments=true&amp;printTitle=Resourceful_Platform_Specific_Testing&amp;entry=3413240159</includedComments:guid>
					<includedComments:puid>blogView?showComments=true&amp;printTitle=Resourceful_Platform_Specific_Testing&amp;entry=3413240159</includedComments:puid>
					<includedComments:author>Travis Griggs</includedComments:author>
					<includedComments:pubDate>2009-02-28T12:27:12-05:00</includedComments:pubDate>
					<includedComments:content>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;p&gt;"Platform" in this context (graphics tests) would be the "display platform". This is not the same as the operating system. For example, you might be running on OSX, but running under X11. Tho the OS is unix mach bsd macosx, the display platform in that case would be X11.&lt;/p&gt;
&lt;/div&gt;</includedComments:content>
					<includedComments:title>Re: Screen and Platform</includedComments:title>
				</includedComments:comment>
			</includedComments:comment-collection>
			<wfw:comment>http://www.cincomsmalltalk.com/userblogs/travis/servlet/CommentAPIServlet?guid=3413240159</wfw:comment>
		</item>
	</channel>
</rss>
