<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Boo</title>
        <link>http://ayende.com/Blog/category/498.aspx</link>
        <description>Boo</description>
        <language>en-US</language>
        <copyright>Ayende Rahien</copyright>
        <managingEditor>Ayende@ayende.com</managingEditor>
        <generator>Subtext Version 2.0.0.0</generator>
        <item>
            <title>Why I HATE editing?</title>
            <link>http://ayende.com/Blog/archive/2009/10/31/why-i-hate-editing.aspx</link>
            <description>&lt;p&gt;I have &lt;em&gt;just&lt;/em&gt; finished 2nd pass editing all the chapters and appendixes for my DSL book. This has been, I think, the 1,390th time that I had gone through the book since I finished writing it. Luckily for me, this appears to be the end, there is the final printer proofs stage, and then I’ll truly be free.&lt;/p&gt;  &lt;p&gt;One of the things that I wasn’t told about when I agree to write the book is just how many times I would have to &lt;em&gt;read&lt;/em&gt; it. I think that I am good writer (God knows that I get enough practice), but for crying out load, there is only so many times that I can read the same piece (especially if I wrote it) before it gets pretty boring.&lt;/p&gt;  &lt;p&gt;Now, to be absolutely clear, the publisher is doing &lt;em&gt;great&lt;/em&gt; job, and I think that each pass has been extremely valuable. We found problems in grammar, spelling, fuzzy speak, missing concepts, bugs in code, etc. This is important, valuable and necessary.&lt;/p&gt;  &lt;p&gt;One of the things that some people have hard time understanding about the way that I think is that I can accept that some things are necessary even if they aren’t fun. That mean that I’ll do them, but I’ll complain about it. Just like taxes. I’ll pay them, but I reserve the right to bitch about it.&lt;/p&gt;  &lt;p&gt;It took me a while to understand why I hate editing so much. I know how to handle boring work, and I know how to handle creative work. What I don’t know how to handle is boring creative work. I split my attention when I am doing boring stuff, usually having something in the background that it interesting while I am doing the boring stuff. For creative stuff, I usually enjoy it.&lt;/p&gt;  &lt;p&gt;But boring creative stuff? I can’t split my attention then, and it &lt;em&gt;is&lt;/em&gt; boring. It is annoying, and I do think about it like a tax.&lt;/p&gt;  &lt;p&gt;Consider this statement, that was flagged by my editor:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;The MacroMacro passes the MacroStatement that the compiler hands to the macro using the name of the macro&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;em&gt;Can&lt;/em&gt; you figure out what I meant here? It took &lt;em&gt;me&lt;/em&gt; a while to do that :-)&lt;/p&gt;  &lt;p&gt;Editing the book has been a huge weight on my mind, having finished that is such a huge relief…&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/11189.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/10/31/why-i-hate-editing.aspx</guid>
            <pubDate>Sat, 31 Oct 2009 10:00:00 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/10/31/why-i-hate-editing.aspx#feedback</comments>
            <slash:comments>6</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/11189.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Building Domain Specific Languages with Boo &amp;ndash; Full book now available</title>
            <link>http://ayende.com/Blog/archive/2009/03/02/building-domain-specific-languages-with-boo-ndash-full-book-now.aspx</link>
            <description>&lt;p&gt;&lt;a href="http://www.manning.com/affiliate/idevaffiliate.php?id=854_111"&gt;&lt;img alt="Building DSL with Boo Cover" src="http://www.ayende.com/images/rahien_cover150.jpg" border="0" /&gt;      &lt;br /&gt;Building Domain Specific Languages with Boo&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Another big milestone, early access subscribers can now read the entire book, all 13 chapters and both appendixes.&lt;/p&gt;  &lt;p&gt;Not edited yet, but much closer to completion.&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10803.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/03/02/building-domain-specific-languages-with-boo-ndash-full-book-now.aspx</guid>
            <pubDate>Mon, 02 Mar 2009 00:22:20 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/03/02/building-domain-specific-languages-with-boo-ndash-full-book-now.aspx#feedback</comments>
            <slash:comments>11</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10803.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Boo Lang Studio 1.0 Alpha it out!</title>
            <link>http://ayende.com/Blog/archive/2008/08/22/Boo-Lang-Studio-1.0-Alpha-it-out.aspx</link>
            <description>&lt;p&gt;Jeffery Olson has just made the first release of &lt;a href="http://www.codeplex.com/BooLangStudio/Release/ProjectReleases.aspx?ReleaseId=16551"&gt;Boo Lang Studio&lt;/a&gt; available. &lt;/p&gt;  &lt;p&gt;This one comes with a "Yes, Dear" installer.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/BooLangStudio1.0Alphaitout_10FE6/image_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="407" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/BooLangStudio1.0Alphaitout_10FE6/image_thumb.png" width="520" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Yeah, we have Boo installed!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/BooLangStudio1.0Alphaitout_10FE6/image_6.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="349" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/BooLangStudio1.0Alphaitout_10FE6/image_thumb_2.png" width="533" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Let us create a new project:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/BooLangStudio1.0Alphaitout_10FE6/image_8.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="468" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/BooLangStudio1.0Alphaitout_10FE6/image_thumb_3.png" width="687" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And take a look at the code: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/BooLangStudio1.0Alphaitout_10FE6/image_12.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="405" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/BooLangStudio1.0Alphaitout_10FE6/image_thumb_5.png" width="678" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And intellisense works as well, whew! &lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/BooLangStudio1.0Alphaitout_10FE6/image_14.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="263" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/BooLangStudio1.0Alphaitout_10FE6/image_thumb_6.png" width="476" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Jeffery Olson and James Gregory: THANKS!&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10456.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2008/08/22/Boo-Lang-Studio-1.0-Alpha-it-out.aspx</guid>
            <pubDate>Fri, 22 Aug 2008 18:14:34 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2008/08/22/Boo-Lang-Studio-1.0-Alpha-it-out.aspx#feedback</comments>
            <slash:comments>10</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10456.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Nicer Linq</title>
            <link>http://ayende.com/Blog/archive/2008/08/14/Nicer-Linq.aspx</link>
            <description>&lt;p&gt;A few days ago I posted about &lt;a href="http://ayende.com/Blog/archive/2008/08/05/Ugly-Linq.aspx"&gt;Ugly Linq&lt;/a&gt;. Ever since then, I kept thinking about how ugly it is to handle this by hand. Suddenly, it hit me that I don't have to do it that way.&lt;/p&gt;  &lt;p&gt;Boo already has the facilities to take a compiler AST and translate that into the code that would recreate this AST. In particular, this makes the code we previously had to write to this:&lt;/p&gt;  &lt;blockquote&gt;   &lt;pre&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; ConditionMacro : AbstractAstMacro
{
	&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; Statement Expand(MacroStatement macro)
	{
		Expression serialize = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; CodeSerializer().Serialize(macro.Arguments[0]);
		var body = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Block();
		body.Statements.Add(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ReturnStatement(macro.Arguments[0]));
		&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ExpressionStatement(
			&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MethodInvocationExpression(
					AstUtil.CreateReferenceExpression(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(Condition).FullName),
					&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; BlockExpression(body),
					serialize
				)

			);
	}
}&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;And what &lt;em&gt;that&lt;/em&gt; means is that given this code:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;condition a &amp;gt; 10&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We can get this result:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/NicerLinq_F922/image_2.png"&gt;&lt;img height="106" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/NicerLinq_F922/image_thumb.png" width="824" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And that is &lt;em&gt;it&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;You get both the actual compiled expression and the AST that describes this. This is critically important because you can now take this piece of AST and do transformations / views on it.&lt;/p&gt;

&lt;p&gt;And &lt;em&gt;that&lt;/em&gt; is important if you want to have reliable graphical representation on top of a textual DSL, which is what my chapter 10 is going to cover.&lt;/p&gt;

&lt;p&gt;Damn, this is simple! Thanks Rodrigo!&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10430.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2008/08/14/Nicer-Linq.aspx</guid>
            <pubDate>Thu, 14 Aug 2008 14:43:31 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2008/08/14/Nicer-Linq.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10430.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Ugly Linq</title>
            <link>http://ayende.com/Blog/archive/2008/08/05/Ugly-Linq.aspx</link>
            <description>&lt;p&gt;One of the things that always bothered me with Linq was that it is actually not an interesting idea from the compiler perspective. I just had to implement a very simple expression to expression tree converter, which only served to strengthen my opinion. Here is the (ugly, proof of concept, horrible) implementation, using the Boo AST:&lt;/p&gt;  &lt;blockquote&gt;   &lt;pre&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; Block Linqify(Expression expr)
{
	var block = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Block(expr.LexicalInfo);
	ReferenceExpression condition = AddCondition(block);
	Parse(block, condition, expr);
	block.Add(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ReturnStatement(condition));
	&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; block;
}

&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; ReferenceExpression AddCondition(Block block)
{
	var condition = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MethodInvocationExpression(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ReferenceExpression("&lt;span style="color: #8b0000"&gt;Condition&lt;/span&gt;"));
	var expression = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ReferenceExpression("&lt;span style="color: #8b0000"&gt;condition_&lt;/span&gt;" + CompilerContext.Current.AllocIndex());
	block.Add(
		&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; BinaryExpression(
			BinaryOperatorType.Assign,
			expression,
			condition)
		);
	&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; expression;
}

&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Parse(Block block, Expression condition, Expression expr)
{
	var be = expr &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; BinaryExpression;
	&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (be != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; (be.Operator == BinaryOperatorType.Or || be.Operator == BinaryOperatorType.And))
	{
		block.Add(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; BinaryExpression(
			BinaryOperatorType.Assign,
			&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MemberReferenceExpression(condition, "&lt;span style="color: #8b0000"&gt;Operator&lt;/span&gt;"),
			&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; StringLiteralExpression(be.Operator.ToString().ToLowerInvariant()))
			);
		ReferenceExpression left = AddCondition(block);
		block.Add(
			&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MethodInvocationExpression(
				&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MemberReferenceExpression(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MemberReferenceExpression(condition, "&lt;span style="color: #8b0000"&gt;Expressions&lt;/span&gt;"), "&lt;span style="color: #8b0000"&gt;Add&lt;/span&gt;"), left));
		ReferenceExpression right = AddCondition(block);
		block.Add(
			&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MethodInvocationExpression(
				&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MemberReferenceExpression(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MemberReferenceExpression(condition, "&lt;span style="color: #8b0000"&gt;Expressions&lt;/span&gt;"), "&lt;span style="color: #8b0000"&gt;Add&lt;/span&gt;"), right));
		Parse(block, left, be.Left);
		Parse(block, right, be.Right);
		&lt;span style="color: #0000ff"&gt;return&lt;/span&gt;;
	}
	var fragment = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MethodInvocationExpression(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ReferenceExpression("&lt;span style="color: #8b0000"&gt;Fragment&lt;/span&gt;"));
	&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (expr &lt;span style="color: #0000ff"&gt;is&lt;/span&gt; UnaryExpression)
	{
		fragment.NamedArguments.Add(
			&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ExpressionPair(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ReferenceExpression("&lt;span style="color: #8b0000"&gt;Modifier&lt;/span&gt;"),
				&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; StringLiteralExpression("&lt;span style="color: #8b0000"&gt;not&lt;/span&gt;"))
			);
		be = (BinaryExpression)((UnaryExpression)expr).Operand;
	}
	var func1 = (MethodInvocationExpression)be.Left;
	fragment.NamedArguments.Add(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ExpressionPair(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ReferenceExpression("&lt;span style="color: #8b0000"&gt;Func1&lt;/span&gt;"), &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; StringLiteralExpression(func1.Target.ToString())));
	fragment.NamedArguments.Add(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ExpressionPair(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ReferenceExpression("&lt;span style="color: #8b0000"&gt;Prop1&lt;/span&gt;"), GetStringArgument(func1.Arguments[0])));
	var func2 = be.Right &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; MethodInvocationExpression;
	&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (func2 != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)
	{
		fragment.NamedArguments.Add(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ExpressionPair(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ReferenceExpression("&lt;span style="color: #8b0000"&gt;Func2&lt;/span&gt;"), &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; StringLiteralExpression(func2.Target.ToString())));
		fragment.NamedArguments.Add(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ExpressionPair(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ReferenceExpression("&lt;span style="color: #8b0000"&gt;Prop2&lt;/span&gt;"), GetStringArgument(func2.Arguments[0])));
	}
	&lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
	{
		fragment.NamedArguments.Add(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ExpressionPair(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ReferenceExpression("&lt;span style="color: #8b0000"&gt;Func2&lt;/span&gt;"), &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; StringLiteralExpression("&lt;span style="color: #8b0000"&gt;literal&lt;/span&gt;")));
		fragment.NamedArguments.Add(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ExpressionPair(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ReferenceExpression("&lt;span style="color: #8b0000"&gt;Prop2&lt;/span&gt;"), GetStringArgument(be.Right)));
	}
	fragment.NamedArguments.Add(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ExpressionPair(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ReferenceExpression("&lt;span style="color: #8b0000"&gt;Operator&lt;/span&gt;"),
		&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; StringLiteralExpression(GetOperator(be))));

	block.Add(
		&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MethodInvocationExpression(
			&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MemberReferenceExpression(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MemberReferenceExpression(condition, "&lt;span style="color: #8b0000"&gt;Expressions&lt;/span&gt;"), "&lt;span style="color: #8b0000"&gt;Add&lt;/span&gt;"), fragment));

}

&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; Expression GetStringArgument(Expression expr)
{
	&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (expr &lt;span style="color: #0000ff"&gt;is&lt;/span&gt; StringLiteralExpression)
		&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; expr;
	&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; StringLiteralExpression(expr.ToString());
}

&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; GetOperator(BinaryExpression be)
{
	&lt;span style="color: #0000ff"&gt;switch&lt;/span&gt; (be.Operator)
	{
		&lt;span style="color: #0000ff"&gt;case&lt;/span&gt; BinaryOperatorType.Equality:
			&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; "&lt;span style="color: #8b0000"&gt;==&lt;/span&gt;";
		&lt;span style="color: #0000ff"&gt;case&lt;/span&gt; BinaryOperatorType.Inequality:
			&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; "&lt;span style="color: #8b0000"&gt;!=&lt;/span&gt;";
		&lt;span style="color: #0000ff"&gt;case&lt;/span&gt; BinaryOperatorType.Member:
			&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; "&lt;span style="color: #8b0000"&gt;in&lt;/span&gt;";
		&lt;span style="color: #0000ff"&gt;case&lt;/span&gt; BinaryOperatorType.LessThan:
			&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; "&lt;span style="color: #8b0000"&gt;&amp;lt;&lt;/span&gt;";
		&lt;span style="color: #0000ff"&gt;case&lt;/span&gt; BinaryOperatorType.LessThanOrEqual:
			&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; "&lt;span style="color: #8b0000"&gt;&amp;lt;=&lt;/span&gt;";
		&lt;span style="color: #0000ff"&gt;case&lt;/span&gt; BinaryOperatorType.GreaterThan:
			&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; "&lt;span style="color: #8b0000"&gt;&amp;gt;&lt;/span&gt;";
		&lt;span style="color: #0000ff"&gt;case&lt;/span&gt; BinaryOperatorType.GreaterThanOrEqual:
			&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; "&lt;span style="color: #8b0000"&gt;&amp;gt;=&lt;/span&gt;";
		&lt;span style="color: #0000ff"&gt;default&lt;/span&gt;:
			&lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; NotSupportedException(be.Operator.ToString());
	}
}&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;This takes a Boo expression and transform that into the code that creates an object model that represents this expression. Linq is simply an extension to this implementation.&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10395.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2008/08/05/Ugly-Linq.aspx</guid>
            <pubDate>Mon, 04 Aug 2008 23:02:18 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2008/08/05/Ugly-Linq.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10395.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Simple State Machine</title>
            <link>http://ayende.com/Blog/archive/2008/05/31/Simple-State-Machine.aspx</link>
            <description>&lt;p&gt;Nathan has posted &lt;a href="http://www.codeplex.com/SimpleStateMachine/"&gt;Simple State Machine&lt;/a&gt; to CodePlex, it is the first project that I am aware of that uses Rhino DSL and the techniques that I am talking about in &lt;a href="http://manning.com/rahien/"&gt;the book&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;What is impressive about this is the level of professionalism that is involved in the project. It is a full scale DSL, with all the supporting infrastructure. I spent half an hour or so going through the entire thing, and I am &lt;em&gt;impressed&lt;/em&gt;.&lt;/p&gt;  &lt;p&gt;Put simply, this is how I think state based work flows should be defined. I could easily see myself extending this a bit to add persistence support &amp;amp; integration with NServiceBus, and be done with it.&lt;/p&gt;  &lt;p&gt;Like most state machines, it has the ideas of states, events that can cause the state to be changed, and legal transitions from state to state. You can define tasks which will be executed upon changing a state, or upon entering / leaving a certain state.&lt;/p&gt;  &lt;p&gt;Enough talking, let us look at a reasonably complex work flow:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; font-family: consolas; mso-bidi-font-family: consolas"&gt;workflow &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas; mso-bidi-font-family: consolas"&gt;"Order Lifecycle"       &lt;p&gt;&lt;/p&gt;     &lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas; mso-bidi-font-family: consolas"&gt;       &lt;p&gt;&lt;/p&gt;     &lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas; mso-bidi-font-family: consolas"&gt;#Event &amp;amp; State Identifier Targets.        &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas; mso-bidi-font-family: consolas"&gt;#This section controls which Types will be used       &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas; mso-bidi-font-family: consolas"&gt;#to resolve Event or State names into strongly typed CLR objects.       &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas; mso-bidi-font-family: consolas"&gt;#--------------------------------------------------------       &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; font-family: consolas; mso-bidi-font-family: consolas"&gt;state_identifier_target &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderStatus       &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; font-family: consolas; mso-bidi-font-family: consolas"&gt;event_identifier_target &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderEvents       &lt;p&gt;&lt;/p&gt;     &lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas; mso-bidi-font-family: consolas"&gt;#Global Actions       &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas; mso-bidi-font-family: consolas"&gt;#--------------------------------------------------------       &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; font-family: consolas; mso-bidi-font-family: consolas"&gt;on_change_state&lt;span style="mso-spacerun: yes"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@WriteToHistory&lt;/span&gt;&lt;span style="font-size: 10pt; color: darkgreen; font-family: consolas; mso-bidi-font-family: consolas"&gt;, &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas; mso-bidi-font-family: consolas"&gt;"on_change_state"       &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; font-family: consolas; mso-bidi-font-family: consolas"&gt;on_workflow_start&lt;span style="mso-spacerun: yes"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@WriteToHistory&lt;/span&gt;&lt;span style="font-size: 10pt; color: darkgreen; font-family: consolas; mso-bidi-font-family: consolas"&gt;, &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas; mso-bidi-font-family: consolas"&gt;"on_workflow_start"       &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; font-family: consolas; mso-bidi-font-family: consolas"&gt;on_workflow_complete &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@WriteToHistory&lt;/span&gt;&lt;span style="font-size: 10pt; color: darkgreen; font-family: consolas; mso-bidi-font-family: consolas"&gt;, &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas; mso-bidi-font-family: consolas"&gt;"on_workflow_complete"       &lt;p&gt;&lt;/p&gt;     &lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas; mso-bidi-font-family: consolas"&gt;#Event Definitions       &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas; mso-bidi-font-family: consolas"&gt;#--------------------------------------------------------       &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; font-family: consolas; mso-bidi-font-family: consolas"&gt;define_event&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderPlaced       &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; font-family: consolas; mso-bidi-font-family: consolas"&gt;define_event&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@CreditCardApproved       &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; font-family: consolas; mso-bidi-font-family: consolas"&gt;define_event&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@CreditCardDenied       &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; font-family: consolas; mso-bidi-font-family: consolas"&gt;define_event&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderCancelledByCustomer       &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; font-family: consolas; mso-bidi-font-family: consolas"&gt;define_event&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OutOfStock       &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; font-family: consolas; mso-bidi-font-family: consolas"&gt;define_event&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderStocked       &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; font-family: consolas; mso-bidi-font-family: consolas"&gt;define_event&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderShipped       &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; font-family: consolas; mso-bidi-font-family: consolas"&gt;define_event&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderReceived       &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; font-family: consolas; mso-bidi-font-family: consolas"&gt;define_event&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderLost       &lt;p&gt;&lt;/p&gt;     &lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas; mso-bidi-font-family: consolas"&gt;#State &amp;amp; Transition Definitions       &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas; mso-bidi-font-family: consolas"&gt;#--------------------------------------------------------       &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; font-family: consolas; mso-bidi-font-family: consolas"&gt;state &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@AwaitingOrder:       &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;&lt;span style="mso-tab-count: 1"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas; mso-bidi-font-family: consolas"&gt;when &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderPlaced&lt;span style="mso-spacerun: yes"&gt;              &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: darkgreen; font-family: consolas; mso-bidi-font-family: consolas"&gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@AwaitingPayment       &lt;p&gt;&lt;/p&gt;     &lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; font-family: consolas; mso-bidi-font-family: consolas"&gt;state &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@AwaitingPayment:       &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;&lt;span style="mso-tab-count: 1"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas; mso-bidi-font-family: consolas"&gt;when &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@CreditCardApproved&lt;span style="mso-spacerun: yes"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: darkgreen; font-family: consolas; mso-bidi-font-family: consolas"&gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@AwaitingShipment       &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;&lt;span style="mso-tab-count: 1"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas; mso-bidi-font-family: consolas"&gt;when &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@CreditCardDenied&lt;span style="mso-spacerun: yes"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: darkgreen; font-family: consolas; mso-bidi-font-family: consolas"&gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderCancelled       &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;&lt;span style="mso-tab-count: 1"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas; mso-bidi-font-family: consolas"&gt;when &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderCancelledByCustomer &lt;/span&gt;&lt;span style="font-size: 10pt; color: darkgreen; font-family: consolas; mso-bidi-font-family: consolas"&gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderCancelled       &lt;p&gt;&lt;/p&gt;     &lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; font-family: consolas; mso-bidi-font-family: consolas"&gt;state &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@AwaitingShipment:       &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;&lt;span style="mso-tab-count: 1"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas; mso-bidi-font-family: consolas"&gt;when &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderCancelledByCustomer &lt;/span&gt;&lt;span style="font-size: 10pt; color: darkgreen; font-family: consolas; mso-bidi-font-family: consolas"&gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderCancelled       &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;&lt;span style="mso-tab-count: 1"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas; mso-bidi-font-family: consolas"&gt;when &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OutOfStock&lt;span style="mso-spacerun: yes"&gt;               &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: darkgreen; font-family: consolas; mso-bidi-font-family: consolas"&gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OnBackorder       &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;&lt;span style="mso-tab-count: 1"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas; mso-bidi-font-family: consolas"&gt;when &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderShipped&lt;span style="mso-spacerun: yes"&gt;             &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: darkgreen; font-family: consolas; mso-bidi-font-family: consolas"&gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@InTransit       &lt;p&gt;&lt;/p&gt;     &lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;&lt;span style="mso-tab-count: 1"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas; mso-bidi-font-family: consolas"&gt;#Individual states can define transition events as well       &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas; mso-bidi-font-family: consolas"&gt;&lt;span style="mso-tab-count: 1"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; font-family: consolas; mso-bidi-font-family: consolas"&gt;on_enter_state &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@WriteToHistory&lt;/span&gt;&lt;span style="font-size: 10pt; color: darkgreen; font-family: consolas; mso-bidi-font-family: consolas"&gt;, &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas; mso-bidi-font-family: consolas"&gt;"on_enter_state(AwaitingShipment)"       &lt;p&gt;&lt;/p&gt;     &lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; font-family: consolas; mso-bidi-font-family: consolas"&gt;state &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OnBackorder:       &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;&lt;span style="mso-tab-count: 1"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas; mso-bidi-font-family: consolas"&gt;when &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderCancelledByCustomer &lt;/span&gt;&lt;span style="font-size: 10pt; color: darkgreen; font-family: consolas; mso-bidi-font-family: consolas"&gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderCancelled       &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;&lt;span style="mso-tab-count: 1"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas; mso-bidi-font-family: consolas"&gt;when &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderStocked&lt;span style="mso-spacerun: yes"&gt;             &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: darkgreen; font-family: consolas; mso-bidi-font-family: consolas"&gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@AwaitingShipment       &lt;p&gt;&lt;/p&gt;     &lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; font-family: consolas; mso-bidi-font-family: consolas"&gt;state &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@InTransit:       &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;&lt;span style="mso-tab-count: 1"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas; mso-bidi-font-family: consolas"&gt;when &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderReceived&lt;span style="mso-spacerun: yes"&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: darkgreen; font-family: consolas; mso-bidi-font-family: consolas"&gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderComplete       &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;&lt;span style="mso-tab-count: 1"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas; mso-bidi-font-family: consolas"&gt;when &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderLost&lt;span style="mso-spacerun: yes"&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: darkgreen; font-family: consolas; mso-bidi-font-family: consolas"&gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@AwaitingShipment       &lt;p&gt;&lt;/p&gt;     &lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas; mso-bidi-font-family: consolas"&gt;#NOTE: State definitions without any transitions will cause       &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas; mso-bidi-font-family: consolas"&gt;#the state machine to Complete when they are reached.       &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas; mso-bidi-font-family: consolas"&gt;#------------------------------------------------------------       &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; font-family: consolas; mso-bidi-font-family: consolas"&gt;state &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderComplete       &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: purple; line-height: 115%; font-family: consolas; mso-bidi-font-family: consolas"&gt;state &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: black; line-height: 115%; font-family: consolas; mso-bidi-font-family: consolas"&gt;@OrderCancelled&lt;/span&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Here is the demo application UI, for the order processing life cycle:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/SimpleStateMachine_369/image_2.png"&gt;&lt;img height="192" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/SimpleStateMachine_369/image_thumb.png" width="795" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;As I said, impressive.&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10248.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2008/05/31/Simple-State-Machine.aspx</guid>
            <pubDate>Fri, 30 May 2008 21:15:26 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2008/05/31/Simple-State-Machine.aspx#feedback</comments>
            <slash:comments>10</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10248.aspx</wfw:commentRss>
        </item>
        <item>
            <title>BooLangStudio: Boo in Visual Studio</title>
            <link>http://ayende.com/Blog/archive/2008/05/30/BooLangStudio-Boo-in-Visual-Studio.aspx</link>
            <description>&lt;p&gt;A few days ago, the &lt;a href="http://www.codeplex.com/BooLangStudio"&gt;BooLangStudio&lt;/a&gt; was announced in the Boo mailing list, bringing Boo support into Visual Studio.&lt;/p&gt;  &lt;p&gt;Below you can see several screen shots. And you can find out more about it &lt;a href="http://www.codinginstinct.com/2008/05/boo-in-visual-studio.html"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;This is a very promising move, especially since I soon have to write my tooling chapter :-)&lt;/p&gt;  &lt;p&gt;Of course, this is still very early in the game, but it is good to see progress in this area again.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/BooLangStudioBooinVisualStudio_146E1/image_2.png"&gt;&lt;img height="313" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/BooLangStudioBooinVisualStudio_146E1/image_thumb.png" width="394" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/BooLangStudioBooinVisualStudio_146E1/image_4.png"&gt;&lt;img height="199" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/BooLangStudioBooinVisualStudio_146E1/image_thumb_1.png" width="229" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10247.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2008/05/30/BooLangStudio-Boo-in-Visual-Studio.aspx</guid>
            <pubDate>Fri, 30 May 2008 20:16:07 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2008/05/30/BooLangStudio-Boo-in-Visual-Studio.aspx#feedback</comments>
            <slash:comments>7</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10247.aspx</wfw:commentRss>
        </item>
        <item>
            <title>The magic of boo - Flexible syntax</title>
            <link>http://ayende.com/Blog/archive/2008/05/27/The-magic-of-boo--Flexible-syntax.aspx</link>
            <description>&lt;p&gt;when I am writing DSL, I keep hitting one pain point. The CLR naming conventions, which are more or less imprinted on my eyelids, are not really conductive to clear reading in a DSL.&lt;/p&gt;  &lt;p&gt;Let us take these entities, and see what we get when we try to build a DSL from them:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ThemagicofbooFlexiblesyntax_A1A0/image_2.png"&gt;&lt;img height="143" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ThemagicofbooFlexiblesyntax_A1A0/image_thumb.png" width="331" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The DSL is for defining business rules, and it looks like this:&lt;/p&gt;  &lt;blockquote&gt;   &lt;pre&gt;&lt;font color="#ff8000"&gt;when&lt;/font&gt; User.IsPreferred &lt;font color="#0000ff"&gt;and&lt;/font&gt; Order.TotalCost &amp;gt; 1000:
	&lt;font color="#ff8000"&gt;AddDiscountPrecentage&lt;/font&gt;  5
	&lt;font color="#ff8000"&gt;ApplyFreeShipping&lt;/font&gt;
&lt;font color="#ff8000"&gt;when&lt;/font&gt; &lt;font color="#0000ff"&gt;not&lt;/font&gt; User.IsPreferred &lt;font color="#0000ff"&gt;and&lt;/font&gt; Order.TotalCost &amp;gt; 1000:
	&lt;font color="#ff8000"&gt;SuggestUpgradeToPreferred&lt;/font&gt; 
	&lt;font color="#ff8000"&gt;ApplyFreeShipping&lt;/font&gt;
&lt;font color="#ff8000"&gt;when&lt;/font&gt; User.IsNotPreferred &lt;font color="#0000ff"&gt;and&lt;/font&gt; Order.TotalCost &amp;gt; 500:
	&lt;font color="#ff8000"&gt;ApplyFreeShipping&lt;/font&gt;&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;The main problem with this style of writing is that it is visually condense. I can read it pretty much as easily as I read natural English, but anyone who is not a developer really have to make an effort, and even for me, trying to read ruby styled code is easier. Here is how this would look like when using the ruby style conventions:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;font color="#ff8000"&gt;when&lt;/font&gt; User.is_preferred &lt;font color="#0000ff"&gt;and&lt;/font&gt; Order.total_cost &amp;gt; 1000:

    &lt;br /&gt;    &lt;font color="#ff8000"&gt;add_discount_precentage&lt;/font&gt; 5

    &lt;br /&gt;    &lt;font color="#ff8000"&gt;apply_free_shipping 
      &lt;br /&gt;when&lt;/font&gt; &lt;font color="#0000ff"&gt;not&lt;/font&gt; User.is_preferred &lt;font color="#0000ff"&gt;and&lt;/font&gt; Order.total_cost &amp;gt; 1000:

    &lt;br /&gt;   &lt;font color="#ff8000"&gt; suggest_upgrade_to_preferred&lt;/font&gt;  &lt;br /&gt;    &lt;font color="#ff8000"&gt;apply_free_shipping 
      &lt;br /&gt;&lt;/font&gt;&lt;font color="#ff8000"&gt;when&lt;/font&gt; User.is_not_preferred &lt;font color="#0000ff"&gt;and&lt;/font&gt; Order.total_cost &amp;gt; 500:

    &lt;br /&gt;   &lt;font color="#ff8000"&gt;apply_free_shipping &lt;/font&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is much easier to read, in my opinion. The problem is that I consider this &lt;em&gt;extremely &lt;/em&gt;ugly.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ThemagicofbooFlexiblesyntax_A1A0/image_4.png"&gt;&lt;img height="143" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ThemagicofbooFlexiblesyntax_A1A0/image_thumb_1.png" width="331" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Obviously a different solution is needed...&lt;/p&gt;

&lt;p&gt;Wait a minute! Boo has an open compiler. Why not just change the way it handle references? And that is what I did:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;pre&gt;&lt;span style="color: #808080"&gt;///&amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #808080"&gt;/// Allow to use underscore separated names, which will be translated to pascal case names.&lt;/span&gt;
&lt;span style="color: #808080"&gt;/// pascal_case -&amp;gt; PascalCase.&lt;/span&gt;
&lt;span style="color: #808080"&gt;/// All names that contains an underscores will go through this treatment.&lt;/span&gt;
&lt;span style="color: #808080"&gt;///&amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #808080"&gt;/// &amp;lt;example&amp;gt;&lt;/span&gt;
&lt;span style="color: #808080"&gt;/// You can  enable this behavior using the following statement&lt;/span&gt;
&lt;span style="color: #808080"&gt;/// &amp;lt;code&amp;gt;&lt;/span&gt;
&lt;span style="color: #808080"&gt;/// compiler.Parameters.Pipeline&lt;/span&gt;
&lt;span style="color: #808080"&gt;///		.Replace(typeof (ProcessMethodBodiesWithDuckTyping),&lt;/span&gt;
&lt;span style="color: #808080"&gt;/// 				 new ProcessMethodBodiesWithDslNamesAndDuckTyping());&lt;/span&gt;
&lt;span style="color: #808080"&gt;/// &amp;lt;/code&amp;gt;&lt;/span&gt;
&lt;span style="color: #808080"&gt;/// &amp;lt;/example&amp;gt;&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; ProcessMethodBodiesWithDslNamesAndDuckTyping : ProcessMethodBodiesWithDuckTyping
{
	&lt;span style="color: #808080"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
	&lt;span style="color: #808080"&gt;/// Called when we encounter a reference expression&lt;/span&gt;
	&lt;span style="color: #808080"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
	&lt;span style="color: #808080"&gt;/// &amp;lt;param name="node"&amp;gt;The node.&amp;lt;/param&amp;gt;&lt;/span&gt;
	&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; OnReferenceExpression(ReferenceExpression node)
	{
		&lt;span style="color: #0000ff"&gt;if&lt;/span&gt;(node.Name.Contains("&lt;span style="color: #8b0000"&gt;_&lt;/span&gt;"))
			SetNodeNameToPascalCase(node);
		&lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.OnReferenceExpression(node);
	}

	&lt;span style="color: #808080"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
	&lt;span style="color: #808080"&gt;/// Called when we encounters a member reference expression&lt;/span&gt;
	&lt;span style="color: #808080"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
	&lt;span style="color: #808080"&gt;/// &amp;lt;param name="node"&amp;gt;The node.&amp;lt;/param&amp;gt;&lt;/span&gt;
	&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; OnMemberReferenceExpression(MemberReferenceExpression node)
	{
		&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (node.Name.Contains("&lt;span style="color: #8b0000"&gt;_&lt;/span&gt;"))
			SetNodeNameToPascalCase(node);
		&lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.OnMemberReferenceExpression(node);
	}

	&lt;span style="color: #808080"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
	&lt;span style="color: #808080"&gt;/// Sets the node name to pascal case.&lt;/span&gt;
	&lt;span style="color: #808080"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
	&lt;span style="color: #808080"&gt;/// &amp;lt;param name="node"&amp;gt;The node.&amp;lt;/param&amp;gt;&lt;/span&gt;
	&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; SetNodeNameToPascalCase(ReferenceExpression node)
	{
		&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[] parts = node.Name.Split(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt;[] { '_' },StringSplitOptions.RemoveEmptyEntries);
		StringBuilder name = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; StringBuilder();
		&lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (var part &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; parts)
		{
			name.Append(&lt;span style="color: #0000ff"&gt;char&lt;/span&gt;.ToUpperInvariant(part[0]))
				.Append(part.Substring(1));
		}
		node.Name = name.ToString();
	}
}&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;I &lt;em&gt;love&lt;/em&gt; Boo, with cause.&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10242.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2008/05/27/The-magic-of-boo--Flexible-syntax.aspx</guid>
            <pubDate>Tue, 27 May 2008 08:30:07 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2008/05/27/The-magic-of-boo--Flexible-syntax.aspx#feedback</comments>
            <slash:comments>12</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10242.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Zero friction IoC: Auto registration is mandatory</title>
            <link>http://ayende.com/Blog/archive/2008/05/13/Zero-friction-IoC-Auto-registration-is-mandatory.aspx</link>
            <description>&lt;p&gt;This is the entire Binsor config file for a real application:&lt;/p&gt;  &lt;blockquote&gt;   &lt;pre&gt;&lt;font color="#0000ff"&gt;import&lt;/font&gt; Castle.MonoRail.Framework
&lt;font color="#0000ff"&gt;import&lt;/font&gt; Castle.MonoRail.WindsorExtension
&lt;font color="#0000ff"&gt;import&lt;/font&gt; Rhino.Commons.Facilities from Rhino.Commons.ActiveRecord

&lt;font color="#ff8000"&gt;facility&lt;/font&gt; MonoRailFacility
&lt;font color="#ff8000"&gt;facility&lt;/font&gt; RhinoTransactionFacility
&lt;font color="#ff8000"&gt;facility&lt;/font&gt; ActiveRecordUnitOfWorkFacility:
	assembly = "&lt;span style="color: #8b0000"&gt;HibernatingRhinos&lt;/span&gt;"

&lt;span style="color: #0000ff"&gt;for&lt;/span&gt; type &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; AllTypesBased of IController("&lt;span style="color: #8b0000"&gt;HibernatingRhinos&lt;/span&gt;"):
	&lt;font color="#ff8000"&gt;component&lt;/font&gt; type.Name, type
	
&lt;span style="color: #0000ff"&gt;for&lt;/span&gt; type &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; AllTypes("&lt;span style="color: #8b0000"&gt;HibernatingRhinos&lt;/span&gt;").WhereNamespaceEq("&lt;span style="color: #8b0000"&gt;HibernatingRhinos.Services&lt;/span&gt;"):
	&lt;font color="#ff8000"&gt;component&lt;/font&gt; type.GetServiceInterface(), type&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;And I am pretty confident that I am not going to have to do much in the future with those.&lt;/p&gt;

&lt;p&gt;And yes, you can do it with the fluent registration API as well. &lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10220.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2008/05/13/Zero-friction-IoC-Auto-registration-is-mandatory.aspx</guid>
            <pubDate>Tue, 13 May 2008 13:08:57 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2008/05/13/Zero-friction-IoC-Auto-registration-is-mandatory.aspx#feedback</comments>
            <slash:comments>6</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10220.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Binsor &amp;amp; Auto Registration - Making it even simpler</title>
            <link>http://ayende.com/Blog/archive/2008/05/13/Binsor-amp-Auto-Registration--Making-it-even-simpler.aspx</link>
            <description>&lt;p&gt;Here is the syntax that I am getting at...&lt;/p&gt;  &lt;blockquote&gt;   &lt;pre&gt;&lt;span style="color: #0000ff"&gt;for&lt;/span&gt; type &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; AllTypesBased of IView("&lt;span style="color: #8b0000"&gt;Rhino.Commons.Test&lt;/span&gt;"):
	component type
	
&lt;span style="color: #0000ff"&gt;for&lt;/span&gt; type &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; AllTypesWithAttribute of ControllerAttribute("&lt;span style="color: #8b0000"&gt;Rhino.Commons.Test&lt;/span&gt;"):
	component type
	
&lt;span style="color: #0000ff"&gt;for&lt;/span&gt; type &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; AllTypes("&lt;span style="color: #8b0000"&gt;Rhino.Commons.Test&lt;/span&gt;") \
	.WhereNamespaceEq("&lt;span style="color: #8b0000"&gt;Rhino.Commons.Test.Binsor&lt;/span&gt;"):
	component type

&lt;span style="color: #0000ff"&gt;for&lt;/span&gt; type &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; AllTypes("&lt;span style="color: #8b0000"&gt;Rhino.Commons.NHibernate&lt;/span&gt;") \
	.Where({ t &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; System.Type | t.Name.Contains("&lt;span style="color: #8b0000"&gt;NHRepository&lt;/span&gt;") }):
	component "&lt;span style="color: #8b0000"&gt;nh.repos&lt;/span&gt;", type.GetSeriveInterface(), type&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;And this seems to cover just about any scenario that I can think of. Combine that with Binsor's extend facility, and we are more or less done.&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10219.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2008/05/13/Binsor-amp-Auto-Registration--Making-it-even-simpler.aspx</guid>
            <pubDate>Tue, 13 May 2008 05:21:51 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2008/05/13/Binsor-amp-Auto-Registration--Making-it-even-simpler.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10219.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>