<?xml version="1.0" encoding="iso-8859-1"?>



<rdf:RDF
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
  xmlns:admin="http://webns.net/mvcb/"
  xmlns:cc="http://web.resource.org/cc/"
  xmlns="http://purl.org/rss/1.0/">

<channel rdf:about="http://blogs.codehaus.org/people/bamboo/">
<title>bamboozled</title>
<link>http://blogs.codehaus.org/people/bamboo/</link>
<description>&quot;digital breeding in an universe of natural selection&quot;</description>
<dc:language>en-us</dc:language>
<dc:creator></dc:creator>
<dc:date>2008-06-19T17:50:13-03:00</dc:date>
<admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=2.661" />
<cc:license rdf:resource="http://creativecommons.org/licenses/by/1.0/" />


<items>
<rdf:Seq><rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001713_cdesign_proponentsists.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001698_boo_082_is_here.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001697_write_once_sharpen_run_anywhere.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001696_why_design.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001688_towards_extensible_parsing.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001667_anthropomorphism_on_computer_science.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001659_boo_081_is_here.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001654_arc_is_out.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001648_make_the_world_a_better_place_with_boo.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001645_and_now_for_something_completely_different.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001642_fractally_reuseable_software.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001641_boo_babel.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001640_back_from_the_mono_summit_07.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001638_claiming_technorati.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001637_mono_summit_2007.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001635_how_to_listen_to_music_with_your_whole_body.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001634_atheists_come_out_of_your_closets.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001633_larry_lessig_how_creativity_is_being_strangled_by_the_law.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001632_the_multiverse_as_a_breadth_first_search_algorithm.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001631_mockingboo_with_meta_programming_facilities.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001629_boojay_does_eclipse.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001627_boojay_discussion_group.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001626_boo_08_is_here.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001625_a_honest_halo_3_review.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001623_introducing_boojay.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001620_a_pattern_matching_facility_for_boo.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001617_something_i_must_read.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001616_frink.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001612_boo_079_is_here.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001606_one_week_with_scala.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001595_good_luck_lessig.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001594_boo_meta_methods_ii.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001593_boo_meta_methods.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001590_boo_078_is_here.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001589_dslfriendly_syntax_ii.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001588_dslfriendly_syntax.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001587_monster_muck_mashup.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001586_domain_model_persistence_on_the_naked_clr.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001580_did_i_say_10x_improvement.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001578_10x_improvement_for_dynamic_dispatching_or_how_it_took_me_4_years_to_optimize_duck_typing.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001577_on_my_way_to_the_dlr_compiler_lab.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001576_overload_resolution_rehaul.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001573_db4o_activation_and_transparent_activation_i.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001567_boo_077_is_here.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001441_db4o_60_is_out.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001386_pair_programming_and_free_play.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001277_a_comparison_of_ruby_and_boo.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001268_cirque_du_soleil.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001256_cecilflowanalysis_is_in.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001248_prevayler_fud.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001237_native_queries_under_the_hood.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001234_running_breezy_now.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001219_miguel_bamboo_and_anders.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001210_static_typing_is_not_about_safety.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001195_free_culture.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001167_mono_meeting_at_the_microsoft_pdc.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001146_eclipseness.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001145_going_to_the_pdc.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001133_the_father_of_c_talks_about_boo.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001127_byecycle_aesthetic_programming_for_eclipse.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001084_subtext.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001016_vmware_on_suse_92amd64_absolutely_rocks.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000988_boo_05_is_here.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000983_db4oboobrowser_is_online.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000968_database_atrophy.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000955_nested_types_dont_work_on_net_20.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000942_boo_in_2005.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000930_vsnet_language_binding_walkthrough.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000926_sharpdevelop_and_boo_looking_good.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000919_compiler_pipelines_and_compiler_profiles.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000895_sovereign_computing.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000894_dont_panic.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000888_booish_meets_java_ii.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000887_booish_meets_java.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000886_it_feels_like_the_old_c_days.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000883_java_api_quirk_of_the_day.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000881_eclipse_jdt_is_deja_vu_all_over.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000872_and_apparently_gwb_pulled_it_off_again.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000868_debugging_boo_code.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000857_interactiveinterpreter_meets_gtk.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000853_systemwindowsforms_meets_booish.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000851_woohoo_booish_is_alive.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000850_towards_a_boo_interactive_shell.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000849_tableless_crossbrowser_menu_thing.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000848_generator_methods_looking_good.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000847_for_the_cat_lovers_out_there.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000843_type_inference_in_boo.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000841_vote_against_bush.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000836_boo_04_is_out.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000834_holy_circumflexes.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000830_monogetoptions_rules.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000825_the_dark_side_of_the_moon_and_the_wizard_of_oz.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000823_setting_propertiesfieldsevents_at_constructtime.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000814_back_to_the_notebook.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000813_its_way_past_time_to_fix_it.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000808_weapons_of_mass_destruction.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000805_sun_ship.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000804_ironpython.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000803_great_hackers.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000798_writing_tests_for_boo.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000795_when_i_was_29.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/000791_boo_explorer_for_linux.html" />
</rdf:Seq>
</items>

</channel>

<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001713_cdesign_proponentsists.html">
<title>cdesign proponentsists</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001713_cdesign_proponentsists.html</link>
<description><![CDATA[<p><a href="http://www.expelledexposed.com/">That</a>'s really funny :)
</p>
<p>It's a copy'n'paste culture indeed.</p>]]></description>
<dc:subject>culture</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2008-06-19T17:50:13-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001698_boo_082_is_here.html">
<title>boo 0.8.2 is here</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001698_boo_082_is_here.html</link>
<description><![CDATA[<p>Yeah, it's that time again!</p>
<p>As usual <a href="http://jira.codehaus.org/secure/IssueNavigator.jspa?reset=true&amp;pid=10671&amp;fixfor=13814http://jira.codehaus.org/secure/IssueNavigator.jspa?reset=true&amp;pid=10671&amp;fixfor=13814">lots and lots of improvements</a> in this new release including:</p>
<ul>
  <li><a href="http://jira.codehaus.org/browse/BOO-807">complete</a> <a href="http://jira.codehaus.org/browse/BOO-805">nullable</a> <a href="http://jira.codehaus.org/browse/BOO-985">type</a> <a href="http://jira.codehaus.org/browse/BOO-822">support</a><br /></li>

  <li><a href="http://jira.codehaus.org/browse/BOO-619">special notation</a> for nullable types (T?) and enumerables (T*)<br /></li>

  <li><a href="http://jira.codehaus.org/browse/BOO-1002">improved booish behavior</a> with nicer colors (it should work inside emacs now :))</li>

  <li><a href="http://jira.codehaus.org/browse/BOO-988">'else' block</a> for 'for' and 'while loops</li>

  <li><a href="http://jira.codehaus.org/browse/BOO-1013">generics</a>, <a href="http://jira.codehaus.org/browse/BOO-1016">generics</a>, <a href="http://jira.codehaus.org/browse/BOO-1005">generics</a></li>

  <li>and <a href="http://jira.codehaus.org/browse/BOO-977">generics</a>!</li>
</ul>
<p>With many many kudos to Avishay Lavie, C&#233;dric Vivier and Marcus Griep!</p>
<p>C&#233;dric deserves special mention for working on all fronts and really pushing for the release. Superb work!</p>
<p>What? - <a href="http://boo.codehaus.org/">http://boo.codehaus.org/</a></p>
<p>Download - <a href="http://boo.codehaus.org/Download">http://boo.codehaus.org/Download</a></p>
<p>Official irc channel - <a href="irc://irc.codehaus.org/boo">irc://irc.codehaus.org/boo</a></p>
<p>Have fun!</p>
]]></description>
<dc:subject></dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2008-05-20T20:06:45-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001697_write_once_sharpen_run_anywhere.html">
<title>Write Once, Sharpen, Run Anywhere</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001697_write_once_sharpen_run_anywhere.html</link>
<description><![CDATA[<p style="font-size: 14px;">When I joined <a href="http://www.db4o.com/">Db4objects</a> a few years ago my first assignment was to research and implement a decent solution for getting db4o to work on the .net platform.</p>
<p style="font-size: 14px;">There was already some investigation going on on using the <a href="http://www.eclipse.org/jdt/">Eclipse JDT API</a> as the basis for a source to source translator which proved to be a wise choice in the long run.</p>
<p style="font-size: 14px;">Eventually <a href="https://source.db4o.com/db4o/trunk/sharpen/">sharpen</a> was born and after <a href="http://developer.db4o.com/blogs/product_news/archive/2006/11/15/new-conventions-for-db4o-on-net.aspx">a lot of love</a> we finally reached a point where <a href="https://source.db4o.com/db4o/trunk/db4oj/core/src/com/db4o/activation/Activator.java">the translated</a> <a href="https://source.db4o.com/db4o/trunk/db4o.net/Db4objects.Db4o/Db4objects.Db4o/Activation/IActivator.cs">c# code</a> would look really good.</p>
<p style="font-size: 14px;">People would get really interested every time sharpen was mentioned but for several reasons it wasn't publicly available.</p>
<p style="font-size: 14px;">Until <a href="http://developer.db4o.com/blogs/product_news/archive/2008/05/20/smart-java-to-c-conversion-for-the-masses-with-sharpen.aspx">now</a>. Hooray!</p>
<p style="font-size: 14px;">I'm really looking forward to what people will build on top of that.</p>
<p style="font-size: 14px;"><br /></p>
]]></description>
<dc:subject></dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2008-05-20T16:41:56-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001696_why_design.html">
<title>Why Design?</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001696_why_design.html</link>
<description><![CDATA[<p>Another great <a href="http://www.ted.com/talks/view/id/197">Ted talk</a>. I particularly love the sequence from 7:08 to 7:40.</p>
<blockquote>
  <p>I'm the man. The final man. You know, we've been mutating for 4 billion years but now because it's me we've stopped.</p>
</blockquote>
<p>Except <a href="http://en.wikipedia.org/wiki/2012#Metaphysical_predictions">this time</a> <a href="http://lhc.web.cern.ch/lhc/">is</a> <a href="http://en.wikipedia.org/wiki/Micro_black_hole">true</a>. :)</p>
]]></description>
<dc:subject></dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2008-05-20T13:33:09-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001688_towards_extensible_parsing.html">
<title>Towards Extensible Parsing</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001688_towards_extensible_parsing.html</link>
<description><![CDATA[<p style="font-size: 15px;">Almost four years ago <a href="http://jira.codehaus.org/browse/BOO-1">the first feature request</a> was entered into the boo issue tracker.</p>
<blockquote>
  <p style="font-size: 15px;">There should be a way to extend the parser so it could recognize custom measurement unit literals such as <strong>1kg</strong> and <strong>2cm</strong>.</p>
</blockquote>
<p style="font-size: 15px;">Since then boo has improved a lot but with no solution for BOO-1 in the horizon.</p>
<p style="font-size: 15px;">I think I'm getting close to solve it in a interesting way using <a href="http://citeseer.ist.psu.edu/643425.html">PEGs</a> implemented as a <a href="http://en.wikipedia.org/wiki/Interpreter_pattern">graph of expression objects</a>.</p>
<p style="font-size: 15px;">PEGs are very likable. Conceptually simple and composable.</p>
<p style="font-size: 15px;">Take the PEG that recognizes integer expressions involving the <strong>+</strong> and <strong>*</strong> operators:</p>
<blockquote>
  <p style="font-size: 15px;">grammar &lt;- spaces addition eof<br />
  addition &lt;- term ("+" spaces term)*<br />
  term &lt;- factor ("*" spaces factor)*<br />
  factor &lt;- [0-9]+ spaces<br />
  spaces &lt;- (' ' / '\t')*<br />
  eof &lt;- !.</p>
</blockquote>
<p style="font-size: 15px;">where:</p>
<blockquote>
  <p style="font-size: 15px;"><strong>()</strong> means grouping.</p>

  <p style="font-size: 15px;"><strong>*</strong> means zero or more matches.</p>

  <p style="font-size: 15px;"><strong>+</strong> means one or more matches.</p>

  <p style="font-size: 15px;"><strong>/</strong> is the prioritized choice operator. If the first expression succeeds, the whole expression succeeds. If the first expression fails, it backtracks and evaluates the second expression.</p>

  <p style="font-size: 15px;"><strong>!</strong> is the not predicate operator which succeeds if its operand fails. It never consumes any input.</p>

  <p style="font-size: 15px;"><strong>.</strong> matches any input.</p>
</blockquote>
<p style="font-size: 15px;">The grammar can be translated to boo very simply using the <strong>peg</strong> macro from <a href="http://code.google.com/p/boo-extensions/source/browse/trunk/extensions/src/Boo.Pegs">Boo.Pegs</a>:</p>
<blockquote>
  <pre>
<font color="#000000"><font color="#006699"><strong>import</strong></font> Boo.Pegs

peg<font color="#000000"><strong>:</strong></font>
    grammar <font color="#000000"><strong>=</strong></font> spaces, addition, eof
    addition <font color="#000000"><strong>=</strong></font> term, <font color="#000000"><strong>--</strong></font><font color="#000000"><strong>(</strong></font><font color="#FF00CC">"</font><font color="#FF00CC">+</font><font color="#FF00CC">"</font>, spaces, term<font color="#000000"><strong>)</strong></font>
    term <font color="#000000"><strong>=</strong></font> factor, <font color="#000000"><strong>--</strong></font><font color="#000000"><strong>(</strong></font><font color="#FF00CC">"</font><font color="#FF00CC">*</font><font color="#FF00CC">"</font>, spaces, factor<font color="#000000"><strong>)</strong></font>
    factor <font color="#000000"><strong>=</strong></font> <font color="#000000"><strong>++</strong></font><font color="#000000"><strong>[</strong></font><font color="#FF0000">0</font><font color="#000000"><strong>-</strong></font><font color="#FF0000">9</font><font color="#000000"><strong>]</strong></font>, spaces
    spaces <font color="#000000"><strong>=</strong></font> <font color="#000000"><strong>--</strong></font><font color="#000000"><strong>(</strong></font><font color="#CC00CC">'</font><font color="#CC00CC"> </font><font color="#CC00CC">'</font> <font color="#000000"><strong>/</strong></font> <font color="#CC00CC">'</font><font color="#CC00CC">\t</font><font color="#CC00CC">'</font><font color="#000000"><strong>)</strong></font>
    eof <font color="#000000"><strong>=</strong></font> <font color="#006699"><strong>not</strong></font> any<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
    
<font color="#0099FF"><strong>assert</strong></font> grammar.Match<font color="#000000"><strong>(</strong></font>PegContext<font color="#000000"><strong>(</strong></font><font color="#FF00CC">"</font><font color="#FF00CC"> </font><font color="#FF00CC"> </font><font color="#FF00CC">6</font><font color="#FF00CC">*</font><font color="#FF00CC">6</font><font color="#FF00CC"> </font><font color="#FF00CC">+</font><font color="#FF00CC"> </font><font color="#FF00CC">6</font><font color="#FF00CC"> </font><font color="#FF00CC">"</font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font></font>
</pre>
</blockquote>
<p style="font-size: 15px;">I had to be a little creative in mapping the PEG operators to valid boo expressions because as it must be clear by now boo doesn't allow the introduction of completely new syntax and that's what the fuss is all about here.</p>
<p style="font-size: 15px;">I actually like the way it looks.</p>
<p style="font-size: 15px;">Implementing something more useful such as expression evaluation on top of that requires a few semantic actions operating a stack:</p>
<blockquote>
  <pre>
<font color="#000000"><font color="#006699"><strong>import</strong></font> Boo.Pegs
<font color="#006699"><strong>import</strong></font> System.Collections.Generic

stack <font color="#000000"><strong>=</strong></font> Stack<font color="#000000"><strong>[</strong></font><font color="#006699"><strong>of</strong></font> <font color="#009966"><strong>int</strong></font><font color="#000000"><strong>]</strong></font><font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
push <font color="#000000"><strong>=</strong></font> stack.Push
pop <font color="#000000"><strong>=</strong></font> stack.Pop

peg<font color="#000000"><strong>:</strong></font>
    grammar <font color="#000000"><strong>=</strong></font> spaces, addition, eof
    addition <font color="#000000"><strong>=</strong></font> term, <font color="#000000"><strong>--</strong></font><font color="#000000"><strong>(</strong></font><font color="#FF00CC">"</font><font color="#FF00CC">+</font><font color="#FF00CC">"</font>, spaces, term, <font color="#000000"><strong>{</strong></font> push<font color="#000000"><strong>(</strong></font>pop<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>+</strong></font> pop<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>}</strong></font><font color="#000000"><strong>)</strong></font>
    term <font color="#000000"><strong>=</strong></font> factor, <font color="#000000"><strong>--</strong></font><font color="#000000"><strong>(</strong></font><font color="#FF00CC">"</font><font color="#FF00CC">*</font><font color="#FF00CC">"</font>, spaces, factor, <font color="#000000"><strong>{</strong></font> push<font color="#000000"><strong>(</strong></font>pop<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>*</strong></font> pop<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>}</strong></font><font color="#000000"><strong>)</strong></font>
    factor <font color="#000000"><strong>=</strong></font> <font color="#000000"><strong>++</strong></font><font color="#000000"><strong>[</strong></font><font color="#FF0000">0</font><font color="#000000"><strong>-</strong></font><font color="#FF0000">9</font><font color="#000000"><strong>]</strong></font>, <font color="#000000"><strong>{</strong></font> push<font color="#000000"><strong>(</strong></font><font color="#009966"><strong>int</strong></font>.Parse<font color="#000000"><strong>(</strong></font>$text<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>}</strong></font>, spaces
    spaces <font color="#000000"><strong>=</strong></font> <font color="#000000"><strong>--</strong></font><font color="#000000"><strong>(</strong></font><font color="#CC00CC">'</font><font color="#CC00CC"> </font><font color="#CC00CC">'</font> <font color="#000000"><strong>/</strong></font> <font color="#CC00CC">'</font><font color="#CC00CC">\t</font><font color="#CC00CC">'</font><font color="#000000"><strong>)</strong></font>
    eof <font color="#000000"><strong>=</strong></font> <font color="#006699"><strong>not</strong></font> any<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
    
<font color="#0099FF"><strong>assert</strong></font> grammar.Match<font color="#000000"><strong>(</strong></font>PegContext<font color="#000000"><strong>(</strong></font><font color="#FF00CC">"</font><font color="#FF00CC"> </font><font color="#FF00CC"> </font><font color="#FF00CC">6</font><font color="#FF00CC">*</font><font color="#FF00CC">6</font><font color="#FF00CC"> </font><font color="#FF00CC">+</font><font color="#FF00CC"> </font><font color="#FF00CC">6</font><font color="#FF00CC"> </font><font color="#FF00CC">"</font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font>
<font color="#0099FF"><strong>assert</strong></font> <font color="#FF0000">42</font> <font color="#000000"><strong>=</strong></font><font color="#000000"><strong>=</strong></font> pop<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font></font>
</pre>
</blockquote>
<p style="font-size: 15px;">Semantic actions are just closures that get executed as matching succeeds. <strong>$text</strong> returns the text matched so far by the current rule.</p>
<p style="font-size: 15px;">Beautiful.</p>
<p style="font-size: 15px;">The underlying implementation based on a graph of expression objects really shines when one considers what it takes to extend the grammar above with support for hexadecimal literals:</p>
<blockquote>
  <pre>
<font color="#000000">peg<font color="#000000"><strong>:</strong></font>
    <font color="#CC0000">//</font><font color="#CC0000"> </font><font color="#CC0000">rebind</font>
    factor.Expression <font color="#000000"><strong>=</strong></font> hex_number <font color="#000000"><strong>/</strong></font> factor.Expression
    hex_number <font color="#000000"><strong>=</strong></font> <font color="#FF00CC">"</font><font color="#FF00CC">0x</font><font color="#FF00CC">"</font>, <font color="#000000"><strong>++</strong></font>hex_digit, <font color="#000000"><strong>{</strong></font> push<font color="#000000"><strong>(</strong></font><font color="#009966"><strong>int</strong></font>.Parse<font color="#000000"><strong>(</strong></font>$text<font color="#000000"><strong>[</strong></font><font color="#FF0000">2</font><font color="#000000"><strong>:</strong></font><font color="#000000"><strong>]</strong></font>, NumberStyles.HexNumber<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>}</strong></font>, spaces
    hex_digit <font color="#000000"><strong>=</strong></font> <font color="#000000"><strong>[</strong></font><font color="#FF0000">0</font><font color="#000000"><strong>-</strong></font><font color="#FF0000">9</font>, a<font color="#000000"><strong>-f</strong></font>, A<font color="#000000"><strong>-<span style="font-weight: normal;">F</span></strong></font><font color="#000000"><strong>]</strong></font>
<font color="#0099FF"><strong>assert</strong></font> grammar.Match<font color="#000000"><strong>(</strong></font>PegContext<font color="#000000"><strong>(</strong></font><font color="#FF00CC">"</font><font color="#FF00CC"> </font><font color="#FF00CC"> </font><font color="#FF00CC">0xa</font><font color="#FF00CC">*</font><font color="#FF00CC">2</font><font color="#FF00CC"> </font><font color="#FF00CC">+</font><font color="#FF00CC"> </font><font color="#FF00CC">11</font><font color="#FF00CC">*</font><font color="#FF00CC">0x02</font><font color="#FF00CC">"</font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font>
<font color="#0099FF"><strong>assert</strong></font> <font color="#FF0000">42</font> <font color="#000000"><strong>=</strong></font><font color="#000000"><strong>=</strong></font> pop<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font></font>
</pre>
</blockquote>
<p style="font-size: 15px;">It's not yet clear how this extensibility mechanism will be exposed at the boo language level but the simplicity at the peg level is encouraging.</p>
<p style="font-size: 15px;">One last feature worth pointing out is the ability to match based on a previously matched rule. For instance, the closing tag of a xml element must match the name in the starting tag:</p>
<blockquote>
  <pre>
<font color="#000000"><font color="#006699"><strong>import</strong></font> Boo.Pegs

peg<font color="#000000"><strong>:</strong></font>
    element <font color="#000000"><strong>=</strong></font> <font color="#CC00CC">'</font><font color="#CC00CC">&lt;</font><font color="#CC00CC">'</font>, tag, <font color="#CC00CC">'</font><font color="#CC00CC">&gt;</font><font color="#CC00CC">'</font>, content, <font color="#CC00CC">'</font><font color="#CC00CC">'</font>, @tag, <font color="#CC00CC">'</font><font color="#CC00CC">&gt;</font><font color="#CC00CC">'</font>
    tag <font color="#000000"><strong>=</strong></font> <font color="#000000"><strong>++</strong></font><font color="#000000"><strong>(</strong></font>a<font color="#000000"><strong>-</strong></font>z<font color="#000000"><strong>)</strong></font>
    content <font color="#000000"><strong>=</strong></font> <font color="#000000"><strong>--</strong></font><font color="#000000"><strong>(</strong></font>element <font color="#000000"><strong>/</strong></font> text<font color="#000000"><strong>)</strong></font>
    text <font color="#000000"><strong>=</strong></font> <font color="#006699"><strong>not</strong></font> <font color="#FF00CC">"</font><font color="#FF00CC">&lt;</font><font color="#FF00CC">"</font>, any<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
    
<font color="#0099FF"><strong>assert</strong></font> element.Match<font color="#000000"><strong>(</strong></font>PegContext<font color="#000000"><strong>(</strong></font><font color="#FF00CC">"</font><font color="#FF00CC">&lt;</font><font color="#FF00CC">foo</font><font color="#FF00CC">&gt;</font><font color="#FF00CC">&lt;</font><font color="#FF00CC">bar</font><font color="#FF00CC">&gt;</font><font color="#FF00CC">Hello</font><font color="#FF00CC">&lt;</font><font color="#FF00CC">/</font><font color="#FF00CC">bar</font><font color="#FF00CC">&gt;</font><font color="#FF00CC">&lt;</font><font color="#FF00CC">/</font><font color="#FF00CC">foo</font><font color="#FF00CC">&gt;</font><font color="#FF00CC">"</font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font></font>
</pre>
</blockquote>
<p style="font-size: 15px;">I've found the idea for the <span style="font-style: italic;">last</span> <span style="font-style: italic;">match</span> operator <strong>@</strong> first described in <a href="http://www.mail-archive.com/peg@lists.csail.mit.edu/msg00020.html">this article</a>. Great idea.</p>
<p style="font-size: 15px;">I've been also greatly inspired by conversations I've had with <a href="http://primates.ximian.com/~massi/blog/">Massi</a> who's <a href="http://primates.ximian.com/~massi/blog/archive/2008/Feb-03.html">exploring similar territory</a> and <a href="http://evain.net/blog/">Jb</a> during the last Mono Meeting in <del>Barcelona</del> Madrid and with <a href="http://www.ohloh.net/accounts/3973">Cedric</a> over a beer in Paris. I think Massi will be pleased to know that I haven't given any thoughts to performance leaving all the fun to him.</p>
<p style="font-size: 15px;">Extensible parsing. Soon in a boo compiler close to you.</p>
<p style="font-size: 15px;"><br /></p>
]]></description>
<dc:subject></dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2008-05-09T01:40:19-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001667_anthropomorphism_on_computer_science.html">
<title>Anthropomorphism on Computer Science</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001667_anthropomorphism_on_computer_science.html</link>
<description><![CDATA[<p>It was more than twenty years ago that Dijkstra wrote against the perils of <a href="http://www.cs.utexas.edu/users/EWD/transcriptions/EWD09xx/EWD936.html" target="_blank">anthropomorphism on science</a>. And here we stand building whole industries on top of it. </p> <p>But is it programming dominantly math? Or is it mainly human communication? </p> <p>Maybe we swung too far to the the latter. I speculate that the current rise of functional programming can also be attributed to its&nbsp; liberating effect - one is no longer expected to attribute proper intent to entities before a program can be seen to make sense.</p> <p>As a constant reminder of that I'm tempted to use a <a href="http://www.luca.demon.co.uk/Fonts.htm" target="_blank">different font</a> for my programming.</p><a title="Dijkstra Font by Rodrigo B. de Oliveira, on Flickr" href="http://www.flickr.com/photos/94072001@N00/2344580747/"><img height="792" alt="Dijkstra Font" src="http://farm4.static.flickr.com/3221/2344580747_66c71e1e85_o.png" width="952"></a>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2008-03-19T09:36:04-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001659_boo_081_is_here.html">
<title>boo 0.8.1 is here</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001659_boo_081_is_here.html</link>
<description><![CDATA[<p><a href="http://jira.codehaus.org/secure/IssueNavigator.jspa?reset=true&amp;pid=10671&amp;fixfor=13813" target="_blank">Lots of improvements</a> in this release including a <a href="http://jira.codehaus.org/browse/BOO-95" target="_blank">simpler way for writing macros</a>, support for <a href="http://jira.codehaus.org/browse/BOO-926" target="_blank">nested functions</a>, a <a href="http://jira.codehaus.org/browse/BOO-834" target="_blank">better interactive interpreter</a>, error messages that include <a href="http://jira.codehaus.org/browse/BOO-959" target="_blank">suggestions for misspelled names</a>, <a href="http://jira.codehaus.org/browse/BOO-879" target="_blank">exception filters</a>, <a href="http://jira.codehaus.org/browse/BOO-880" target="_blank">exception fault handlers</a> and <a href="http://jira.codehaus.org/browse/BOO-24" target="_blank">for loop IDisposeable.Dispose integration</a>.</p> <p>With many many kudos to Avishay Lavie, Cédric Vivier, Daniel Grunwald and Marcus Griep!</p> <p>What? - <a href="http://boo.codehaus.org/">http://boo.codehaus.org/</a><br>Download - <a href="http://boo.codehaus.org/Download">http://boo.codehaus.org/Download</a><br>Official irc channel - irc://irc.codehaus.org/boo</p> <p>Have fun!</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2008-02-08T14:34:42-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001654_arc_is_out.html">
<title>arc is out</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001654_arc_is_out.html</link>
<description><![CDATA[<p><a href="http://paulgraham.com/" target="_blank">Paul Graham</a>'s <a href="http://ycombinator.com/arc/tut.txt" target="_blank">arc language</a> is finally out.</p> <blockquote> <p>"One of the things you'll discover as you learn more about macros is how much day-to-day coding in other languages consists of manually generating macro expansions." </p></blockquote><strong>Amem!</strong>]]></description>
<dc:subject></dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2008-01-30T15:46:44-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001648_make_the_world_a_better_place_with_boo.html">
<title>Make the world a better place with boo</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001648_make_the_world_a_better_place_with_boo.html</link>
<description><![CDATA[<p></p> <p>Gaiaware has just announced the <a href="http://ajaxwidgets.com/news_gaia_programming_contest.aa">Gaia Programming Contest</a>. A contest "... about creating an Ajax Application that will serve as a meeting place for people dedicated to solving environmental issues...". </p> <p>Very good but there's more: "... no Close Source dependencies can be used which means that the end product must be compilable on <a href="http://www.mono-project.com/Main_Page">Mono</a> ...". Great!</p> <p>Of course people using <a href="http://boo.codehaus.org/">boo</a> and <a href="http://www.db4o.com/">db4o</a> have a huge headstart. So what are you waiting for?</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-12-20T17:19:31-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001645_and_now_for_something_completely_different.html">
<title>And now for something completely different...</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001645_and_now_for_something_completely_different.html</link>
<description><![CDATA[<p><a href="http://tirania.org/blog/archive/2007/Dec-14.html">Dennis Kucinich for emperor!</a></p>]]></description>
<dc:subject>life</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-12-14T17:01:07-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001642_fractally_reuseable_software.html">
<title>Fractally reuseable software</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001642_fractally_reuseable_software.html</link>
<description><![CDATA[<p>It's reuseable as whole and any individual piece you look at it's just as reuseable.</p> <p>Yeah, I'm enjoying the Criptonomicom so far.</p>]]></description>
<dc:subject></dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-12-06T08:35:34-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001641_boo_babel.html">
<title>Boo Babel</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001641_boo_babel.html</link>
<description><![CDATA[<p>As I went through the conference memories I recovered this one conversation I had with <a href="http://blog.secondlife.com/author/babbagelinden/">Jim Purbrick</a> after the boo presentation.</p> <p>His idea would be to have boo as the language for building languages in Second Life.</p> <p><a href="http://en.wikipedia.org/wiki/Power_to_the_People_%28song%29">Niiiiice</a>.</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-12-04T15:17:33-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001640_back_from_the_mono_summit_07.html">
<title>Back From the Mono Summit 07</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001640_back_from_the_mono_summit_07.html</link>
<description><![CDATA[<p><img src="http://www.mono-project.com/files/4/42/Summit.png" align="right"> </p> <p>What a great experience.  <p>A chance to interact live with a <a href="http://evain.net/blog/">dear friend</a>. Free Software, Hacking, Women, Futurama, McDonalds, love spreading, Militant Atheism, Monty Python, Douglas Adams and the French Way.  <p>Had lots of interesting exchange of ideas with <a href="http://primates.ximian.com/~massi/all.html">Massi</a>, ranging from "extensible parsing through composeable PEGs with&nbsp; optimal performance" to Carlos Castañeda, Jesus Christ, meta-physics, religion and Pink Floyd. The <a href="http://en.wikipedia.org/wiki/Cryptonomicon">Cryptonomicon</a> really got me.  <p>Got to put a face on <a href="http://forum.unity3d.com/profile.php?mode=viewprofile&amp;u=3">Joachim</a> and see how really cool <a href="http://otee.dk/">Unity</a> is.  <p><a href="http://weblog.ikvm.net/">Jeroen IKVM Frijters</a> is a funny guy!  <p>On Thursday I got to <a href="http://codehaus.org/~bamboo/MonoSummit07-db4o.pdf">talk</a> about <a href="http://www.db4o.com/">db4o</a> which led me to meet a few db4o users hanging around the conference.  <blockquote> <p>Pedro Santos had an interesting question, how to monitor and control the usage of computational resources in a managed client/server application? In other words, how a sysadmin can make sure a specific client won't DOS the application?  <p>For .NET servers running on Windows there are performance counters, what about Mono servers running on Linux?</p></blockquote> <p>I've also got to spread the gospel about <a href="http://boo.codehaus.org/">boo</a> for which I got a hugely positive response.  <blockquote> <p><a href="http://ajaxwidgets.com/Blogs/thomas.bb">Thomas "Gaia" Hansen</a> seemed to really get it and so we had lots of interesting discussions on how to take over the world boo style.</p> <p><a href="http://jacksonito.blogspot.com/">Jackson</a> wants to hack on better nullable type support for boo!</p> <p><a href="http://schani.wordpress.com/">Mark</a> wants an extensible language where NullReferenceExceptions are impossible.</p> <p><a href="http://tirania.org/blog/index.html">Miguel</a> reassured me once again mcs won't be rewritten on top of the boo compiler infrastructure :)</p></blockquote> <p>The presentation material is <a href="http://boo.codehaus.org/MonoSummit2007/">here</a>.  <p>Looking forward to the next one.  ]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-12-04T09:43:44-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001638_claiming_technorati.html">
<title>Claiming Technorati</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001638_claiming_technorati.html</link>
<description><![CDATA[<p>
Following Carl's steps I'm also claiming my blog by publishing a link to my <a href="http://technorati.com/claim/r6e8b22pqy" rel="me">Technorati Profile</a>.
</p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-11-26T06:22:39-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001637_mono_summit_2007.html">
<title>Mono Summit 2007</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001637_mono_summit_2007.html</link>
<description><![CDATA[<p>
So it's official now, I'll be speaking at the <a href="http://www.mono-project.com/Mono_Summit_2007_Schedule">Mono Summit 2007</a>. <br /><br />
It will be great to see you there!<br /><br />

Many thanks to the great folks at <a href="http://www.db4o.com/">db4o</a> for sponsoring my trip.</br >
</p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-11-13T14:54:04-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001635_how_to_listen_to_music_with_your_whole_body.html">
<title>How to listen to music with your whole body</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001635_how_to_listen_to_music_with_your_whole_body.html</link>
<description><![CDATA[<p><a href="http://www.ted.com/index.php/talks/view/id/103">Evelyn Glennie shares with us just how.</a>
<br /><br />
Amazing presentation by an amazing human being/musician.
</p>]]></description>
<dc:subject>culture</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-11-09T22:01:41-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001634_atheists_come_out_of_your_closets.html">
<title>Atheists come out of your closets</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001634_atheists_come_out_of_your_closets.html</link>
<description><![CDATA[<p><a href="http://www.ted.com/talks/view/id/113">Richard Dawkins: An atheist's call to arms.</a></p>]]></description>
<dc:subject>culture</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-11-09T20:44:21-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001633_larry_lessig_how_creativity_is_being_strangled_by_the_law.html">
<title>Larry Lessig: How creativity is being strangled by the law</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001633_larry_lessig_how_creativity_is_being_strangled_by_the_law.html</link>
<description><![CDATA[<p>Lessig gives an inspiring talk on <a href="http://www.ted.com/talks/view/id/187">how creativity is being strangled by the law</a>.
<br /><br />
Quoting <a href="http://evain.net/blog/">JB</a>: &quot;We need more of <a href="http://www.ted.com/talks/view/id/187">him</a>&quot;
<br /><br />
We certainly do. We certainly do.
</p>]]></description>
<dc:subject>culture</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-11-09T08:02:37-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001632_the_multiverse_as_a_breadth_first_search_algorithm.html">
<title>The multiverse as a breadth first search algorithm</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001632_the_multiverse_as_a_breadth_first_search_algorithm.html</link>
<description><![CDATA[<p>
I had the most fascinating dream last night, very complex and full of details and by its very nature impossible for me to describe it. It was mix of the Tao, The Hitchhiker's Guide to The Galaxy, Big Bang Theory and Computer Science and if I was to sum it all up it would be something like "<b>the multiverse as a breadth-first search algorithm</b>".
<br /><br />
So what would be the optimal universe configuration? Looking from where I stand it's hard to believe it's going to be ours.
<br /></br >
I don't believe I'm the first one to think it that way so now I'm googling for references. Drop me a line if you know of any.
</p>
<p><b>Update 1:</b> <a href="http://www.amazon.com/exec/obidos/tg/detail/-/1400033861/ref=ord_cart_shr/105-6449813-6202043?%5Fencoding=UTF8&m=ATVPDKIKX0DER&v=glance">this</a> seems to be close enough so I'm definitely getting it.</p>
<p><b>Update 2:</b> I got depth-first and breadth-first mixed up :)</p>

]]></description>
<dc:subject>life</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-11-06T09:06:58-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001631_mockingboo_with_meta_programming_facilities.html">
<title>MockingBoo with meta programming facilities</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001631_mockingboo_with_meta_programming_facilities.html</link>
<description><![CDATA[<p><a href="http://ayende.com/Blog/Default.aspx">Oren</a> talks about a <a href="http://ayende.com/Blog/archive/2007/10/30/Mocking-Boo.aspx">simple but interesting macro to aid with mocking</a>. I decided to see if and how the latest meta programming facilities I've been working on are actually useful. Here's the complete application, what do you think?
</p>
<pre><font color="#000000">    <font color="#006699"><strong>namespace</strong></font> Adapter

    <font color="#006699"><strong>import</strong></font> Boo.Lang.Compiler
    <font color="#006699"><strong>import</strong></font> Boo.Lang.Compiler.Ast
    <font color="#006699"><strong>import</strong></font> Boo.Lang.Compiler.Ast.Visitors
    <font color="#006699"><strong>import</strong></font> Boo.Lang.Compiler.TypeSystem
    <font color="#006699"><strong>import</strong></font> Boo.Lang.Compiler.MetaProgramming

    <font color="#006699"><strong>class</strong></font> AdapterMacro<font color="#000000"><strong>(</strong></font>AbstractAstMacro<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
        <font color="#006699"><strong>def</strong></font> Expand<font color="#000000"><strong>(</strong></font>macro <font color="#006699"><strong>as</strong></font> MacroStatement<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
            <font color="#006699"><strong>if</strong></font> macro.Arguments.Count <font color="#000000"><strong>!=</strong></font> <font color="#ff0000">1</font> <font color="#006699"><strong>or</strong></font> <font color="#006699"><strong>not</strong></font> macro.Arguments<font color="#000000"><strong>[</strong></font><font color="#ff0000">0</font><font color="#000000"><strong>]</strong></font> <font color="#006699"><strong>isa</strong></font> ReferenceExpression<font color="#000000"><strong>:</strong></font>
                <font color="#006699"><strong>raise</strong></font> <font color="#ff00cc">&quot;</font><font color="#ff00cc">adapter</font><font color="#ff00cc"> </font><font color="#ff00cc">must</font><font color="#ff00cc"> </font><font color="#ff00cc">be</font><font color="#ff00cc"> </font><font color="#ff00cc">called</font><font color="#ff00cc"> </font><font color="#ff00cc">with</font><font color="#ff00cc"> </font><font color="#ff00cc">a</font><font color="#ff00cc"> </font><font color="#ff00cc">single</font><font color="#ff00cc"> </font><font color="#ff00cc">argument</font><font color="#ff00cc">&quot;</font>

            entity <font color="#000000"><strong>=</strong></font> NameResolutionService.Resolve<font color="#000000"><strong>(</strong></font>macro.Arguments<font color="#000000"><strong>[</strong></font><font color="#ff0000">0</font><font color="#000000"><strong>]</strong></font>.ToString<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font>
            <font color="#006699"><strong>raise</strong></font> <font color="#ff00cc">&quot;</font><font color="#ff00cc">adapter</font><font color="#ff00cc"> </font><font color="#ff00cc">only</font><font color="#ff00cc"> </font><font color="#ff00cc">accept</font><font color="#ff00cc"> </font><font color="#ff00cc">types</font><font color="#ff00cc">&quot;</font> <font color="#006699"><strong>unless</strong></font> entity.EntityType <font color="#000000"><strong>=</strong></font><font color="#000000"><strong>=</strong></font> EntityType.Type
            BuildType<font color="#000000"><strong>(</strong></font>macro, entity<font color="#000000"><strong>)</strong></font>

        <font color="#006699"><strong>def</strong></font> GetModule<font color="#000000"><strong>(</strong></font>node <font color="#006699"><strong>as</strong></font> Node<font color="#000000"><strong>)</strong></font> <font color="#006699"><strong>as</strong></font> Boo.Lang.Compiler.Ast.Module<font color="#000000"><strong>:</strong></font>
            <font color="#006699"><strong>return</strong></font> node.GetAncestor<font color="#000000"><strong>(</strong></font>NodeType.Module<font color="#000000"><strong>)</strong></font>

        <font color="#006699"><strong>def</strong></font> BuildType<font color="#000000"><strong>(</strong></font>macro <font color="#006699"><strong>as</strong></font> MacroStatement, type <font color="#006699"><strong>as</strong></font> IType<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
            adapterInterface <font color="#000000"><strong>=</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font>
                <font color="#006699"><strong>interface</strong></font> $<font color="#000000"><strong>(</strong></font><font color="#ff00cc">&quot;</font><font color="#ff00cc">I</font><font color="#ff00cc">&quot;</font> <font color="#000000"><strong>+</strong></font> type.Name<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
                    <font color="#006699"><strong>pass</strong></font>
            <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font>

            adapter <font color="#000000"><strong>=</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font>
                <font color="#006699"><strong>class</strong></font> $<font color="#000000"><strong>(</strong></font>type.Name <font color="#000000"><strong>+</strong></font> <font color="#ff00cc">&quot;</font><font color="#ff00cc">Adapter</font><font color="#ff00cc">&quot;</font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>(</strong></font>$adapterInterface<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>

                    theTarget <font color="#006699"><strong>as</strong></font> $<font color="#000000"><strong>(</strong></font>type.FullName<font color="#000000"><strong>)</strong></font>

                    <font color="#006699"><strong>def</strong></font> <font color="#006699"><strong>constructor</strong></font><font color="#000000"><strong>(</strong></font>target <font color="#006699"><strong>as</strong></font> $<font color="#000000"><strong>(</strong></font>type.FullName<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
                        theTarget <font color="#000000"><strong>=</strong></font> target
            <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font>

            GetModule<font color="#000000"><strong>(</strong></font>macro<font color="#000000"><strong>)</strong></font>.Members.Add<font color="#000000"><strong>(</strong></font>adapter<font color="#000000"><strong>)</strong></font>
            GetModule<font color="#000000"><strong>(</strong></font>macro<font color="#000000"><strong>)</strong></font>.Members.Add<font color="#000000"><strong>(</strong></font>adapterInterface<font color="#000000"><strong>)</strong></font>

            <font color="#006699"><strong>for</strong></font> member <font color="#006699"><strong>in</strong></font> type.GetMembers<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
                AddMethod<font color="#000000"><strong>(</strong></font>adapter, adapterInterface,  member<font color="#000000"><strong>)</strong></font> <font color="#006699"><strong>if</strong></font> member <font color="#006699"><strong>isa</strong></font> IMethod

            BooPrinterVisitor<font color="#000000"><strong>(</strong></font>System.Console.Out<font color="#000000"><strong>)</strong></font>.Visit<font color="#000000"><strong>(</strong></font>adapterInterface<font color="#000000"><strong>)</strong></font>
            BooPrinterVisitor<font color="#000000"><strong>(</strong></font>System.Console.Out<font color="#000000"><strong>)</strong></font>.Visit<font color="#000000"><strong>(</strong></font>adapter<font color="#000000"><strong>)</strong></font>

        <font color="#006699"><strong>def</strong></font> AddMethod<font color="#000000"><strong>(</strong></font>adapter <font color="#006699"><strong>as</strong></font> ClassDefinition,
                adapterInterface <font color="#006699"><strong>as</strong></font> InterfaceDefinition,
                method <font color="#006699"><strong>as</strong></font> IMethod<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>

            <font color="#006699"><strong>if</strong></font> <font color="#006699"><strong>not</strong></font> method.IsPublic<font color="#000000"><strong>:</strong></font> <font color="#006699"><strong>return</strong></font>
            <font color="#006699"><strong>if</strong></font> method.IsStatic<font color="#000000"><strong>:</strong></font> <font color="#006699"><strong>return</strong></font>
            <font color="#006699"><strong>if</strong></font> method.ReturnType.IsByRef<font color="#000000"><strong>:</strong></font> <font color="#006699"><strong>return</strong></font>
            <font color="#006699"><strong>if</strong></font> method.ReturnType.IsArray<font color="#000000"><strong>:</strong></font> <font color="#006699"><strong>return</strong></font>

            interfaceMethod <font color="#000000"><strong>=</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font>
                <font color="#006699"><strong>def</strong></font> $<font color="#000000"><strong>(</strong></font>method.Name<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font> <font color="#006699"><strong>as</strong></font> $<font color="#000000"><strong>(</strong></font>method.ReturnType.FullName<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
                    <font color="#006699"><strong>pass</strong></font>
            <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font>

            forwarder <font color="#000000"><strong>=</strong></font> interfaceMethod.CloneNode<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>

            forwardInvocation <font color="#000000"><strong>=</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font> theTarget.$<font color="#000000"><strong>(</strong></font>method.Name<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font>
            <font color="#006699"><strong>for</strong></font> param <font color="#006699"><strong>in</strong></font> method.GetParameters<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
                <font color="#006699"><strong>if</strong></font> param.IsByRef <font color="#006699"><strong>or</strong></font> param.Type.IsArray<font color="#000000"><strong>:</strong></font>
                    <font color="#006699"><strong>return</strong></font>

                forwarder.Parameters.Add<font color="#000000"><strong>(</strong></font>
                    ParameterDeclaration<font color="#000000"><strong>(</strong></font>
                        Name<font color="#000000"><strong>:</strong></font> param.Name,
                        Type<font color="#000000"><strong>:</strong></font> SimpleTypeReference<font color="#000000"><strong>(</strong></font>param.Type.FullName<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font>

                interfaceMethod.Parameters.Add<font color="#000000"><strong>(</strong></font>
                    ParameterDeclaration<font color="#000000"><strong>(</strong></font>
                        Name<font color="#000000"><strong>:</strong></font> param.Name,
                        Type<font color="#000000"><strong>:</strong></font> SimpleTypeReference<font color="#000000"><strong>(</strong></font>param.Type.FullName<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font>

                forwardInvocation.Arguments.Add<font color="#000000"><strong>(</strong></font>ReferenceExpression<font color="#000000"><strong>(</strong></font>param.Name<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font>


            adapterInterface.Members.Add<font color="#000000"><strong>(</strong></font>interfaceMethod<font color="#000000"><strong>)</strong></font>
            adapter.Members.Add<font color="#000000"><strong>(</strong></font>forwarder<font color="#000000"><strong>)</strong></font>

            <font color="#006699"><strong>if</strong></font> method.ReturnType <font color="#000000"><strong>=</strong></font><font color="#000000"><strong>=</strong></font> TypeSystemServices.VoidType<font color="#000000"><strong>:</strong></font>
                forwarder.Body.Add<font color="#000000"><strong>(</strong></font>forwardInvocation<font color="#000000"><strong>)</strong></font>
            <font color="#006699"><strong>else</strong></font><font color="#000000"><strong>:</strong></font>
                forwarder.Body.Add<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font> <font color="#006699"><strong>return</strong></font> $forwardInvocation <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font><font color="#000000"><strong>)</strong></font>


    code <font color="#000000"><strong>=</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font>
        <font color="#006699"><strong>import</strong></font> Adapter

        adapter <font color="#009966"><strong>int</strong></font>

        <font color="#0099ff"><strong>print</strong></font> Int32Adapter<font color="#000000"><strong>(</strong></font><font color="#ff0000">42</font><font color="#000000"><strong>)</strong></font> <font color="#006699"><strong>isa</strong></font> IInt32
    <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font>

    <font color="#006699"><strong>try</strong></font><font color="#000000"><strong>:</strong></font>
        module <font color="#000000"><strong>=</strong></font> compile<font color="#000000"><strong>(</strong></font>code, <font color="#0099ff"><strong>typeof</strong></font><font color="#000000"><strong>(</strong></font>AdapterMacro<font color="#000000"><strong>)</strong></font>.Assembly<font color="#000000"><strong>)</strong></font>
        module.EntryPoint.Invoke<font color="#000000"><strong>(</strong></font><font color="#cc00cc">null</font>, <font color="#000000"><strong>(</strong></font><font color="#cc00cc">null</font>,<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font>
    <font color="#006699"><strong>except</strong></font> x <font color="#006699"><strong>as</strong></font> CompilationErrorsException<font color="#000000"><strong>:</strong></font>
        <font color="#0099ff"><strong>print</strong></font> x.Errors.ToString<font color="#000000"><strong>(</strong></font><font color="#cc00cc">true</font><font color="#000000"><strong>)</strong></font>

</font></pre>
]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-10-31T09:50:27-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001629_boojay_does_eclipse.html">
<title>boojay does eclipse</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001629_boojay_does_eclipse.html</link>
<description><![CDATA[<p>
<a href="http://www.flickr.com/photos/94072001@N00/1767840956/" title="Photo Sharing"><img src="http://farm3.static.flickr.com/2059/1767840956_c8051f9b17.jpg" width="500" height="374" alt="boojay does eclipse" /></a>
<br />
Today history was made. The first eclipse plugin written in boo and compiled down to java bytecodes by boojay has come to life. The plugin is a direct translation of the the plugin described <a href="http://www.eclipse.org/articles/Article-Your%20First%20Plug-in/YourFirstPlugin.html">here</a>.
<br />
And the boo code:
<br />
<pre><font color="#000000">    <font color="#ff00cc">&quot;&quot;&quot;</font>
<font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc">Hello</font><font color="#ff00cc"> </font><font color="#ff00cc">World</font><font color="#ff00cc"> </font><font color="#ff00cc">eclipse</font><font color="#ff00cc"> </font><font color="#ff00cc">plugin</font><font color="#ff00cc">.</font>

<font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc">A</font><font color="#ff00cc"> </font><font color="#ff00cc">direct</font><font color="#ff00cc"> </font><font color="#ff00cc">translation</font><font color="#ff00cc"> </font><font color="#ff00cc">of</font>
<font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc">http</font><font color="#ff00cc">:</font><font color="#ff00cc">/</font><font color="#ff00cc">/</font><font color="#ff00cc">www</font><font color="#ff00cc">.</font><font color="#ff00cc">eclipse</font><font color="#ff00cc">.</font><font color="#ff00cc">org</font><font color="#ff00cc">/</font><font color="#ff00cc">articles</font><font color="#ff00cc">/</font><font color="#ff00cc">Article</font><font color="#ff00cc">-</font><font color="#ff00cc">Your</font><font color="#ff00cc">%</font><font color="#ff00cc">20First</font><font color="#ff00cc">%</font><font color="#ff00cc">20Plug</font><font color="#ff00cc">-</font><font color="#ff00cc">in</font><font color="#ff00cc">/</font><font color="#ff00cc">YourFirstPlugin</font><font color="#ff00cc">.</font><font color="#ff00cc">html</font>
<font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc">to</font><font color="#ff00cc"> </font><font color="#ff00cc">boo</font><font color="#ff00cc">.</font>
<font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc">&quot;&quot;&quot;</font>
    <font color="#006699"><strong>namespace</strong></font> HelloWorldPlugin

    <font color="#006699"><strong>import</strong></font> org.eclipse.ui
    <font color="#006699"><strong>import</strong></font> org.eclipse.jface.action
    <font color="#006699"><strong>import</strong></font> org.eclipse.jface.dialogs
    <font color="#006699"><strong>import</strong></font> org.eclipse.jface.viewers

    <font color="#006699"><strong>class</strong></font> HelloWorldAction<font color="#000000"><strong>(</strong></font>IWorkbenchWindowActionDelegate<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>

        activeWindow <font color="#006699"><strong>as</strong></font> IWorkbenchWindow

        <font color="#006699"><strong>def</strong></font> run<font color="#000000"><strong>(</strong></font>proxyAction <font color="#006699"><strong>as</strong></font> IAction<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
            <font color="#0099ff"><strong>shell</strong></font> <font color="#000000"><strong>=</strong></font> activeWindow.getShell<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
            MessageDialog.openInformation<font color="#000000"><strong>(</strong></font><font color="#0099ff"><strong>shell</strong></font>, <font color="#ff00cc">&quot;</font><font color="#ff00cc">Hello</font><font color="#ff00cc"> </font><font color="#ff00cc">from</font><font color="#ff00cc"> </font><font color="#ff00cc">boojay</font><font color="#ff00cc">!</font><font color="#ff00cc">&quot;</font>, <font color="#ff00cc">&quot;</font><font color="#ff00cc">Hello</font><font color="#ff00cc"> </font><font color="#ff00cc">World</font><font color="#ff00cc">!</font><font color="#ff00cc">&quot;</font><font color="#000000"><strong>)</strong></font>

        <font color="#006699"><strong>def</strong></font> init<font color="#000000"><strong>(</strong></font>window <font color="#006699"><strong>as</strong></font> IWorkbenchWindow<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
            activeWindow <font color="#000000"><strong>=</strong></font> window

        <font color="#006699"><strong>def</strong></font> dispose<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
            <font color="#006699"><strong>pass</strong></font>

        <font color="#006699"><strong>def</strong></font> selectionChanged<font color="#000000"><strong>(</strong></font>proxyAction <font color="#006699"><strong>as</strong></font> IAction, selection <font color="#006699"><strong>as</strong></font> ISelection<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
            <font color="#006699"><strong>pass</strong></font>


</font></pre>



</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-10-27T00:33:14-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001627_boojay_discussion_group.html">
<title>boojay discussion group</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001627_boojay_discussion_group.html</link>
<description><![CDATA[<p>
If you think it makes sense to have a JVM backend for the <a href="http://boo.codehaus.org/">boo programming language</a>, <a href="http://groups.google.com/group/boojay/">join us</a>.
</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-10-25T22:08:48-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001626_boo_08_is_here.html">
<title>boo 0.8 is here</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001626_boo_08_is_here.html</link>
<description><![CDATA[<p>
This release includes bug fixes, performance improvements and better meta-programming capabilities [1].
<br /><br />
Special thanks to Marcus Griep, Nick Fortune and Matt McElheny!
<br /><br />
What? - <a href="http://boo.codehaus.org/">http://boo.codehaus.org/ </a><br />
Download - <a href="http://boo.codehaus.org/Download">http://boo.codehaus.org/Download</a> <br />
Official irc channel - <a href="irc://irc.codehaus.org/boo">irc://irc.codehaus.org/boo</a> <br />
<br /><br />
Complete change log <a href="http://jira.codehaus.org/browse/BOO?report=com.atlassian.jira.plugin.system.project:changelog-panel">here</a>.
<br />
Have fun!
<br />
[1] see the 'match' and 'data' macros in the <a href="http://code.google.com/p/boo-extensions/">boo-extensions</a> project for examples]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-10-25T14:08:04-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001625_a_honest_halo_3_review.html">
<title>A honest Halo 3 review</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001625_a_honest_halo_3_review.html</link>
<description><![CDATA[<p>Yeah, <a href="http://www.escapistmagazine.com/articles/view/editorials/zeropunctuation/2304-Zero-Punctuation-Halo-3">I won't be playing Halo 3</a> unless I get one for free (hint, hint).
</p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-10-24T11:56:56-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001623_introducing_boojay.html">
<title>Introducing boojay</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001623_introducing_boojay.html</link>
<description><![CDATA[<p>Consider the following simple application for a moment:<br />

<pre><font color="#000000"><font color="#006699"><strong>import</strong></font> org.eclipse.swt
<font color="#006699"><strong>import</strong></font> org.eclipse.swt.widgets

display <font color="#000000"><strong>=</strong></font> Display<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
<font color="#0099ff"><strong>shell</strong></font> <font color="#000000"><strong>=</strong></font> Shell<font color="#000000"><strong>(</strong></font>display<font color="#000000"><strong>)</strong></font>
<font color="#0099ff"><strong>shell</strong></font>.setText<font color="#000000"><strong>(</strong></font><font color="#ff00cc">&quot;</font><font color="#ff00cc">Hello</font><font color="#ff00cc">!</font><font color="#ff00cc">&quot;</font><font color="#000000"><strong>)</strong></font>
<font color="#0099ff"><strong>shell</strong></font>.setSize<font color="#000000"><strong>(</strong></font><font color="#ff0000">200</font>, <font color="#ff0000">200</font><font color="#000000"><strong>)</strong></font>
<font color="#0099ff"><strong>shell</strong></font>.open<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>

<font color="#006699"><strong>while</strong></font> <font color="#006699"><strong>not</strong></font> <font color="#0099ff"><strong>shell</strong></font>.isDisposed<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
    <font color="#006699"><strong>if</strong></font> <font color="#006699"><strong>not</strong></font> display.readAndDispatch<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
        display.sleep<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
        
display.dispose<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
</font></pre>
<p>A <a href="http://boo.codehaus.org/">boo</a> application using the <a href="http://www.eclipse.org/swt/">SWT</a> java GUI library. Thanks to <a href="http://ikvm.net/">IKVM</a> that's not only possible but very simple as well.</p>
<p />
<p>So what's the news? Well, Friday morning I was chatting with <a href="http://www.blogger.com/profile/6652942">Klaus</a> and he said to me "if you get boo to emit java bytecodes I'll do all my stuff in boo". How's that for a challenge? :)</p>
<p>Thanks again to <a href="http://ikvm.net/">IKVM</a>, <a href="http://asm.objectweb.org/">ObjectWeb ASM</a> and <a href="http://boo.codehaus.org/BooManifesto.pdf">the extensible boo pipeline architecture</a> after a weekend of relaxed hacking <a href="http://boo-extensions.googlecode.com/svn/trunk/boojay/">boojay</a> was born.</p>
</p>
<p><b>UPDATE: </b>Just in case it's not clear, the generated class files <b>DO NOT</b> require IKVM in any way and can be executed in any compliant JVM.</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-10-23T20:21:29-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001620_a_pattern_matching_facility_for_boo.html">
<title>A Pattern Matching facility for boo</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001620_a_pattern_matching_facility_for_boo.html</link>
<description><![CDATA[<p>I've finally took some time off this weekend to implement a simple object pattern matching facility as part of the newly created <a href="http://code.google.com/p/boo-extensions">boo-extensions</a> project.<br /><br />
Here's some <a href="http://boo-extensions.googlecode.com/svn/trunk/extensions/examples/expressions/Program.boo">code</a> using the new <a href="http://boo-extensions.googlecode.com/svn/trunk/extensions/src/Boo.PatternMatching/MatchMacro.boo">'match'</a> and <a href="http://boo-extensions.googlecode.com/svn/trunk/extensions/src/Boo.Adt/DataMacro.boo">'data' </a>macros to implement an expression evaluator:
<br />
  <pre><font color="#000000"><font color="#006699"><strong>import</strong></font> Boo.PatternMatching
<font color="#006699"><strong>import</strong></font> Boo.Adt

<font color="#006699"><strong>def</strong></font> eval<font color="#000000"><strong>(</strong></font>e <font color="#006699"><strong>as</strong></font> Expression<font color="#000000"><strong>)</strong></font> <font color="#006699"><strong>as</strong></font> <font color="#009966"><strong>int</strong></font><font color="#000000"><strong>:</strong></font>
   match e<font color="#000000"><strong>:</strong></font>
      case Const<font color="#000000"><strong>(</strong></font>value<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
        <font color="#006699"><strong>return</strong></font> value
      case Add<font color="#000000"><strong>(</strong></font>left, right<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
        <font color="#006699"><strong>return</strong></font> eval<font color="#000000"><strong>(</strong></font>left<font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>+</strong></font> eval<font color="#000000"><strong>(</strong></font>right<font color="#000000"><strong>)</strong></font>

<font color="#006699"><strong>def</strong></font> simplify<font color="#000000"><strong>(</strong></font>e <font color="#006699"><strong>as</strong></font> Expression<font color="#000000"><strong>)</strong></font> <font color="#006699"><strong>as</strong></font> Expression<font color="#000000"><strong>:</strong></font>
    match e<font color="#000000"><strong>:</strong></font>
        case Add<font color="#000000"><strong>(</strong></font>left<font color="#000000"><strong>:</strong></font> Const<font color="#000000"><strong>(</strong></font>value<font color="#000000"><strong>:</strong></font> <font color="#ff0000">0</font><font color="#000000"><strong>)</strong></font>, right<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
            <font color="#006699"><strong>return</strong></font> simplify<font color="#000000"><strong>(</strong></font>right<font color="#000000"><strong>)</strong></font>
        case Add<font color="#000000"><strong>(</strong></font>left, right<font color="#000000"><strong>:</strong></font> Const<font color="#000000"><strong>(</strong></font>value<font color="#000000"><strong>:</strong></font> <font color="#ff0000">0</font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
            <font color="#006699"><strong>return</strong></font> simplify<font color="#000000"><strong>(</strong></font>left<font color="#000000"><strong>)</strong></font>
        case Add<font color="#000000"><strong>(</strong></font>left, right<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
            <font color="#006699"><strong>return</strong></font> Add<font color="#000000"><strong>(</strong></font>simplify<font color="#000000"><strong>(</strong></font>left<font color="#000000"><strong>)</strong></font>, simplify<font color="#000000"><strong>(</strong></font>right<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font>
        case _<font color="#000000"><strong>:</strong></font>
            <font color="#006699"><strong>return</strong></font> _

data Expression <font color="#000000"><strong>=</strong></font> Const<font color="#000000"><strong>(</strong></font>value <font color="#006699"><strong>as</strong></font> <font color="#009966"><strong>int</strong></font><font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>|</strong></font> Add<font color="#000000"><strong>(</strong></font>left <font color="#006699"><strong>as</strong></font> Expression, right <font color="#006699"><strong>as</strong></font> Expression<font color="#000000"><strong>)</strong></font>

e <font color="#000000"><strong>=</strong></font> Add<font color="#000000"><strong>(</strong></font>Add<font color="#000000"><strong>(</strong></font>Const<font color="#000000"><strong>(</strong></font><font color="#ff0000">19</font><font color="#000000"><strong>)</strong></font>, Const<font color="#000000"><strong>(</strong></font><font color="#ff0000">0</font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font>, Add<font color="#000000"><strong>(</strong></font>Const<font color="#000000"><strong>(</strong></font><font color="#ff0000">0</font><font color="#000000"><strong>)</strong></font>, Const<font color="#000000"><strong>(</strong></font><font color="#ff0000">23</font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font>

<font color="#0099ff"><strong>print</strong></font> simplify<font color="#000000"><strong>(</strong></font>e<font color="#000000"><strong>)</strong></font>
<font color="#0099ff"><strong>print</strong></font> eval<font color="#000000"><strong>(</strong></font>e<font color="#000000"><strong>)</strong></font>
<font color="#0099ff"><strong>print</strong></font> eval<font color="#000000"><strong>(</strong></font>simplify<font color="#000000"><strong>(</strong></font>e<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font>

</font></pre>
</p>

<p>'match' coupled with our recently acquired quasiquoting capabilities makes writing macros for boo a pleasant endeavour actually.<br /><br />
Dont believe me? Take a look at the <a href="http://boo-extensions.googlecode.com/svn/trunk/extensions/src/Boo.Adt/DataMacro.boo">data macro</a> again.</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-10-16T18:22:37-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001617_something_i_must_read.html">
<title>Something I must read...</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001617_something_i_must_read.html</link>
<description><![CDATA[<p>This is a <a href="http://www.gigamonkeys.com/book/">Lisp tutorial</a> worth reading.</p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-09-20T14:19:25-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001616_frink.html">
<title>Frink</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001616_frink.html</link>
<description><![CDATA[<p><a href="http://futureboy.us/frinkdocs/">This</a> is so nice.</p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-09-17T23:24:52-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001612_boo_079_is_here.html">
<title>Boo 0.7.9 is here!</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001612_boo_079_is_here.html</link>
<description><![CDATA[<p>This release includes bug fixes, improves on generic support and introduces a few <a href="http://blogs.codehaus.org/people/bamboo/archives/001593_boo_meta_methods.html">metaprogramming facilities</a> (still on early stage).</p>

<p>Many thanks to the growing boo community!</p>

<p>What? - <a href="http://boo.codehaus.org/">http://boo.codehaus.org/</a><br />
Download - <a href="http://boo.codehaus.org/Download">http://boo.codehaus.org/Download</a><br />
Official irc channel - <a href="irc://irc.codehaus.org/boo">irc://irc.codehaus.org/boo</a></p>

<p>Full change log <a href="http://jira.codehaus.org/browse/BOO?report=com.atlassian.jira.plugin.system.project:changelog-panel">here</a>.</p>

<p>Have fun!</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-09-01T13:33:55-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001606_one_week_with_scala.html">
<title>One Week With Scala</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001606_one_week_with_scala.html</link>
<description><![CDATA[<p>It all really started when Bob Pasker asked me if <a href="http://www.db4o.com/">db4o </a>worked with <a href="http://www.scala-lang.org/">scala</a>. That kind of subtext is usually all I need to start exploring another programming language. Specially one of such a tasty functional flavor.</p>

<p>My experiment was to port a simple time tracking application I wrote for myself some time ago from .net/boo to jvm/scala.</p>

<p>The application works as a tray icon that lets you right-click your way through projects and tasks. There's no reporting interface other than a REPL window that allows you to execute arbitrary code against the app's object model :)</p>

<p>It actually took me only a week to get it up and running on the three major platforms I work with (windows, linux and macosx) thanks to scala, db4o and swt.</p>

<p>My impression so far is pretty darn good. </p>

<p>Scala is a beautiful language.</p>

<p>The tight integration with java means great tools such as db4o work out of the box.</p>

<p>And the eclipse support goes as far as supporting eclipse plugins written in scala (niiiice).</p>

<p>If you do java you should really be giving scala a ride.</p>

<p>You can find the application at <a href="http://code.google.com/p/sttracker/">http://code.google.com/p/sttracker/</a>.</p>

<p>There's a readme with instructions on how to get it running either through eclipse or ant.</p>

<p>Even if you dont care about the time tracking functionality at all I think the SWT REPL window should give you some fun :)<br />
</p>]]></description>
<dc:subject>db4o</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-08-07T14:40:18-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001595_good_luck_lessig.html">
<title>Good luck, Lessig</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001595_good_luck_lessig.html</link>
<description><![CDATA[<p>I had the privilege to attend to <a href="http://www.lessig.org/" target="_blank">Lessig</a>'s talk at the <a href="http://fisl.softwarelivre.org" target="_blank">FISL</a> some time ago. It really moved me.</p>

<p>I wish him the best of luck on <a href="http://www.lessig.org/blog/archives/003800.shtml" target="_blank">his new crusade</a>.</p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-06-21T11:19:19-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001594_boo_meta_methods_ii.html">
<title>Boo meta methods II</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001594_boo_meta_methods_ii.html</link>
<description><![CDATA[<p>By the way named arguments can also be used with meta methods:</p>

<pre><font color="#000000">    a <font color="#000000"><strong>=</strong></font> dict<font color="#000000"><strong>(</strong></font>A<font color="#000000"><strong>:</strong></font> <font color="#ff00cc">&quot;</font><font color="#ff00cc">foo</font><font color="#ff00cc">&quot;</font>, B<font color="#000000"><strong>:</strong></font> <font color="#ff00cc">&quot;</font><font color="#ff00cc">bar</font><font color="#ff00cc">&quot;</font><font color="#000000"><strong>)</strong></font></font></pre>
Possible implementation:

<pre><font color="#000000">    <font color="#000000"><strong>[</strong></font>meta<font color="#000000"><strong>]</strong></font>
    <font color="#006699"><strong>def</strong></font> dict<font color="#000000"><strong>(</strong></font>keywords <font color="#006699"><strong>as</strong></font> <font color="#000000"><strong>(</strong></font>ExpressionPair<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
        h <font color="#000000"><strong>=</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font> <font color="#000000"><strong>{</strong></font><font color="#000000"><strong>}</strong></font> <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font>
        <font color="#006699"><strong>for</strong></font> pair <font color="#006699"><strong>in</strong></font> keywords<font color="#000000"><strong>:</strong></font>
            h.Items.Add<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font> $<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>(</strong></font>pair.First <font color="#006699"><strong>as</strong></font> ReferenceExpression<font color="#000000"><strong>)</strong></font>.Name<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font> $<font color="#000000"><strong>(</strong></font>pair.Second<font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font><font color="#000000"><strong>)</strong></font>
        <font color="#006699"><strong>return</strong></font> h</font></pre>
Keyword arguments are all collected into an array passed as the first argument to the meta method. That way, meta methods can still do pattern matching on the number and types of expression arguments.]]></description>
<dc:subject></dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-06-21T00:07:37-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001593_boo_meta_methods.html">
<title>Boo meta methods</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001593_boo_meta_methods.html</link>
<description><![CDATA[<p>Boo meta methods are methods that take code trees as input and return code trees as output. In addition they must be marked with the <b>MetaAttribute </b> for the compiler to recognize them as so.</p>

<p>The compiler invokes meta methods during the type resolution phase and replaces the code tree at the point of invocation with the code tree returned by the meta method.</p>

<p>Multiple overloads can be specified in which case the types of the code tree arguments will be used for the purpose of overload resolution.</p>

<p><h3>An example, assert</h3></p>

<p>Assert can be invoked with one or two arguments:</p>

<pre><font color="#000000">    <font color="#0099ff"><strong>assert</strong></font> x <font color="#006699"><strong>is</strong></font> <font color="#cc00cc">null</font> <font color="#cc0000">//</font><font color="#cc0000"> </font><font color="#cc0000">use</font><font color="#cc0000"> </font><font color="#cc0000">the</font><font color="#cc0000"> </font><font color="#cc0000">code</font><font color="#cc0000"> </font><font color="#cc0000">as</font><font color="#cc0000"> </font><font color="#cc0000">the</font><font color="#cc0000"> </font><font color="#cc0000">assertion</font><font color="#cc0000"> </font><font color="#cc0000">message</font>
    <font color="#0099ff"><strong>assert</strong></font> x <font color="#006699"><strong>is</strong></font> <font color="#006699"><strong>not</strong></font> <font color="#cc00cc">null</font>, <font color="#ff00cc">&quot;</font><font color="#ff00cc">x</font><font color="#ff00cc"> </font><font color="#ff00cc">shouldn</font><font color="#ff00cc">'</font><font color="#ff00cc">t</font><font color="#ff00cc"> </font><font color="#ff00cc">be</font><font color="#ff00cc"> </font><font color="#ff00cc">null</font><font color="#ff00cc">&quot;</font> <font color="#cc0000">//</font><font color="#cc0000"> </font><font color="#cc0000">custom</font><font color="#cc0000"> </font><font color="#cc0000">exception</font><font color="#cc0000"> </font><font color="#cc0000">or</font><font color="#cc0000"> </font><font color="#cc0000">string</font>
</font></pre>

<p>One way of implementing assert would be:</p>

<pre><font color="#000000">    <font color="#000000"><strong>[</strong></font>meta<font color="#000000"><strong>]</strong></font> <font color="#006699"><strong>def</strong></font> <font color="#0099ff"><strong>assert</strong></font><font color="#000000"><strong>(</strong></font>condition <font color="#006699"><strong>as</strong></font> Expression<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
        <font color="#006699"><strong>return</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font>
            <font color="#006699"><strong>if</strong></font> <font color="#006699"><strong>not</strong></font> $condition<font color="#000000"><strong>:</strong></font>
                <font color="#006699"><strong>raise</strong></font> AssertionFailedException<font color="#000000"><strong>(</strong></font>$<font color="#000000"><strong>(</strong></font>condition.ToCodeString<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font>
        <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font>
    
    <font color="#000000"><strong>[</strong></font>meta<font color="#000000"><strong>]</strong></font> <font color="#006699"><strong>def</strong></font> <font color="#0099ff"><strong>assert</strong></font><font color="#000000"><strong>(</strong></font>condition <font color="#006699"><strong>as</strong></font> Expression, exception <font color="#006699"><strong>as</strong></font> Expression<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
        <font color="#006699"><strong>return</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font>
            <font color="#006699"><strong>if</strong></font> <font color="#006699"><strong>not</strong></font> $condition<font color="#000000"><strong>:</strong></font>
                <font color="#006699"><strong>raise</strong></font> $exception
        <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font>
</font></pre>
	
Where <b>[| |]</b> are the <a href="http://en.wikipedia.org/wiki/Quasi-quotation" target="_blank">quasi-quotation</a> delimiters. A quasi-quote evaluates its body as a code tree expression.

<p><b>$</b> is generally called the "splice" operator and it means "evaluate me at compilation time".<br />
	<br />
Alternatively, assert could declare a variable parameter list:</p>

<pre><font color="#000000">    <font color="#000000"><strong>[</strong></font>meta<font color="#000000"><strong>]</strong></font> <font color="#006699"><strong>def</strong></font> <font color="#0099ff"><strong>assert</strong></font><font color="#000000"><strong>(</strong></font><font color="#000000"><strong>*</strong></font>arguments <font color="#006699"><strong>as</strong></font> <font color="#000000"><strong>(</strong></font>Expression<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
        condition <font color="#000000"><strong>=</strong></font> arguments<font color="#000000"><strong>[</strong></font><font color="#ff0000">0</font><font color="#000000"><strong>]</strong></font>
        <font color="#006699"><strong>if</strong></font> <font color="#0099ff"><strong>len</strong></font><font color="#000000"><strong>(</strong></font>arguments<font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>&gt;</strong></font> <font color="#ff0000">1</font><font color="#000000"><strong>:</strong></font>
            <font color="#cc0000">//</font><font color="#cc0000"> </font><font color="#cc0000">assuming</font><font color="#cc0000"> </font><font color="#cc0000">2</font><font color="#cc0000"> </font><font color="#cc0000">arguments</font>
            exception <font color="#000000"><strong>=</strong></font> arguments<font color="#000000"><strong>[</strong></font><font color="#ff0000">1</font><font color="#000000"><strong>]</strong></font>
        <font color="#006699"><strong>else</strong></font><font color="#000000"><strong>:</strong></font>
            exception <font color="#000000"><strong>=</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font> AssertionFailedException<font color="#000000"><strong>(</strong></font>$<font color="#000000"><strong>(</strong></font>condition.ToCodeString<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font>
        <font color="#006699"><strong>return</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font>
            <font color="#006699"><strong>if</strong></font> <font color="#006699"><strong>not</strong></font> $condition<font color="#000000"><strong>:</strong></font>
                <font color="#006699"><strong>raise</strong></font> $exception
        <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font> 
</font></pre>	

<p>An interesting aspect of boo's splicing semantics is exemplified by the subexpression:</p>

<pre><font color="#000000">    <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font> AssertionFailedException<font color="#000000"><strong>(</strong></font>$<font color="#000000"><strong>(</strong></font>condition.ToCodeString<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font>
</font></pre>
	
The splice application <b>$(condition.ToCodeString())</b> automatically lifts the string value returned by ToCodeString to a proper StringLiteralExpression.

<p><h3>Another example, using</h3></p>

<p>'using' provides for deterministic disposal of resources. The argument should implement the IDisposable interface to have its Dispose method called<br />
at the end of a provided code block.</p>

<p>For instance, the following code:</p>

<pre><font color="#000000">    <font color="#0099ff"><strong>using</strong></font> socket<font color="#000000"><strong>=</strong></font>OpenConnection<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
        socket.Send<font color="#000000"><strong>(</strong></font><font color="#ff00cc">&quot;</font><font color="#ff00cc">ping</font><font color="#ff00cc">&quot;</font><font color="#000000"><strong>)</strong></font>
</font></pre>
		
should be expanded to something equivalent to:

<pre><font color="#000000">    socket<font color="#000000"><strong>=</strong></font>OpenConnection<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
    <font color="#006699"><strong>try</strong></font><font color="#000000"><strong>:</strong></font>
        socket.Send<font color="#000000"><strong>(</strong></font><font color="#ff00cc">&quot;</font><font color="#ff00cc">ping</font><font color="#ff00cc">&quot;</font><font color="#000000"><strong>)</strong></font>
    <font color="#006699"><strong>ensure</strong></font><font color="#000000"><strong>:</strong></font>
        <font color="#006699"><strong>if</strong></font> socket <font color="#006699"><strong>isa</strong></font> IDisposable<font color="#000000"><strong>:</strong></font> <font color="#000000"><strong>(</strong></font>socket <font color="#006699"><strong>as</strong></font> IDisposable<font color="#000000"><strong>)</strong></font>.Dispose<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
</font></pre>
		
A possible implementation for 'using' follows:

<pre><font color="#000000">    <font color="#000000"><strong>[</strong></font>meta<font color="#000000"><strong>]</strong></font> <font color="#006699"><strong>def</strong></font> <font color="#0099ff"><strong>using</strong></font><font color="#000000"><strong>(</strong></font>e <font color="#006699"><strong>as</strong></font> Expression, block <font color="#006699"><strong>as</strong></font> BlockExpression<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
        temp <font color="#000000"><strong>=</strong></font> uniqueName<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
        <font color="#006699"><strong>return</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font>
            $temp <font color="#000000"><strong>=</strong></font> $e
            <font color="#006699"><strong>try</strong></font><font color="#000000"><strong>:</strong></font>
                $<font color="#000000"><strong>(</strong></font>block.Body<font color="#000000"><strong>)</strong></font>
            <font color="#006699"><strong>ensure</strong></font><font color="#000000"><strong>:</strong></font>
                <font color="#006699"><strong>if</strong></font> $temp <font color="#006699"><strong>isa</strong></font> IDisposable<font color="#000000"><strong>:</strong></font> <font color="#000000"><strong>(</strong></font>$temp <font color="#006699"><strong>as</strong></font> IDisposable<font color="#000000"><strong>)</strong></font>.Dispose<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
        <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font>
</font></pre>		

<p><h3>More about quasi-quotation</h3></p>

<p>Due to the reuse of syntactic elements in different contexts the parser needs to follow some conventions in order to infer the meaning of a quasi-quote expression.</p>

<p>Take the quasi-quote <b>[| a as string |]</b>. What does it mean? If we were to interpret it as an expression it would mean a try cast expression. If we were to interpret it as a type member it would mean a field definition.</p>

<p>For the inline form the convention is to try to interpret it as either an expression or an expression pair or an import declaration or a namespace declaration.</p>

<p>The block form is first probed for a type member definition then for a  single statement, then for a block of statements.and then for a module. </p>

<p>Example:</p>

<p> <pre><font color="#000000">    e <font color="#000000"><strong>=</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font> a <font color="#006699"><strong>as</strong></font> <font color="#009966"><strong>string</strong></font> <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font><br />
    <font color="#0099ff"><strong>assert</strong></font> e <font color="#006699"><strong>isa</strong></font> TryCastExpression<br />
    <br />
    f <font color="#000000"><strong>=</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font><br />
        a <font color="#006699"><strong>as</strong></font> <font color="#009966"><strong>string</strong></font><br />
    <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font><br />
    <font color="#0099ff"><strong>assert</strong></font> f <font color="#006699"><strong>isa</strong></font> Field<br />
    <br />
    m <font color="#000000"><strong>=</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font><br />
        <font color="#006699"><strong>namespace</strong></font> Spam<br />
        <br />
        <font color="#0099ff"><strong>print</strong></font> <font color="#ff00cc">&quot;</font><font color="#ff00cc">Spam</font><font color="#ff00cc">!</font><font color="#ff00cc"> </font><font color="#ff00cc">&quot;</font><font color="#000000"><strong>*</strong></font><font color="#ff0000">3</font><br />
    <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font><br />
    <font color="#0099ff"><strong>assert</strong></font> m <font color="#006699"><strong>isa</strong></font> Module<br />
</font></pre></p>

<p>It should be possible to specify the exact context of quasi-quotation by using some special syntax but the specific details are not clear at this point.</p>

<p>Soon to reach a svn repository near you.</p>

<p>Oh, yeah, and many thanks to the people behind <a href="http://www.haskell.org/th/" target="_blank">Template Haskell</a>!</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-06-20T19:19:35-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001590_boo_078_is_here.html">
<title>Boo 0.7.8 is here</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001590_boo_078_is_here.html</link>
<description><![CDATA[<p>Boo 0.7.8 is here!</p>

<p>With many thanks to the people who contributed for this release: Andrew Davey, Avishay Lavie, Cedric Vivier, Chris Prinos, Doug Holton, Jim Lewis and Max Bolingbroke.</p>

<p>What? - <a href="http://boo.codehaus.org/" target="_blank">http://boo.codehaus.org/</a><br />
Download - <a href="http://boo.codehaus.org/Download">http://boo.codehaus.org/Download</a><br />
Official irc channel - irc://irc.codehaus.org/boo</p>

<p>Highlights for this release include <a href="http://blogs.codehaus.org/people/bamboo/archives/001578_10x_improvement_for_dynamic_dispatching_or_how_it_took_me_4_years_to_optimize_duck_typing.html" target="_blank">dramatic improvements to dynamic dispatching performance</a>, <a href="http://blogs.codehaus.org/people/bamboo/archives/001588_dslfriendly_syntax.html" target="_blank">a friendlier DSL syntax</a> and of course bug fixes. This is also the <b>last release to support .net 1.1</b>.</p>

<p>Full change log <a href="http://jira.codehaus.org/browse/BOO?report=com.atlassian.jira.plugin.system.project:changelog-panel" target="_blank">here</a>.</p>]]></description>
<dc:subject></dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-06-12T12:56:27-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001589_dslfriendly_syntax_ii.html">
<title>DSL-friendly syntax II</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001589_dslfriendly_syntax_ii.html</link>
<description><![CDATA[<p><p>My good friend <a href="http://evain.net/blog/">JB</a> has just let me know it was <a href="http://evain.net/blog/articles/2006/05/01/and-you-thought-xlinq-was-cool">his idea</a>.</p></p>

<p><p>Sorry, JB :)</p></p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-06-07T10:20:58-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001588_dslfriendly_syntax.html">
<title>DSL-friendly syntax</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001588_dslfriendly_syntax.html</link>
<description><![CDATA[<p>Georges showed me today how he was using a boo DSL to generate HTML:</p>

<pre><font color="#000000"><font color="#000000">   1:</font>html<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font> <font color="#006699"><strong>do</strong></font><font color="#000000"><strong>:</strong></font>
<font color="#000000">   2:</font>    body<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font> <font color="#006699"><strong>do</strong></font><font color="#000000"><strong>:</strong></font>
<font color="#000000">   3:</font>        text<font color="#000000"><strong>(</strong></font><font color="#ff00cc">&quot;</font><font color="#ff00cc">Hello</font><font color="#ff00cc">,</font><font color="#ff00cc"> </font><font color="#ff00cc">world</font><font color="#ff00cc">!</font><font color="#ff00cc">&quot;</font><font color="#000000"><strong>)</strong></font>
</font></pre>


<p>The idea is to use nested closures to represent the hierarchy of tags: </p>

<pre><font color="#000000"><font color="#000000">   1:</font>        
<font color="#000000">   2:</font><font color="#006699"><strong>callable</strong></font> Block<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
<font color="#000000">   3:</font>
<font color="#000000">   4:</font><font color="#006699"><strong>def</strong></font> blockTag<font color="#000000"><strong>(</strong></font>tagName <font color="#006699"><strong>as</strong></font> <font color="#009966"><strong>string</strong></font>, block <font color="#006699"><strong>as</strong></font> Block<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
<font color="#990066">   5:</font>    <font color="#0099ff"><strong>print</strong></font> <font color="#ff00cc">&quot;</font><font color="#ff00cc">&lt;</font><font color="#9900cc">${</font><font color="#9900cc">tagName</font><font color="#9900cc">}</font><font color="#ff00cc">&gt;</font><font color="#ff00cc">&quot;</font>
<font color="#000000">   6:</font>    block<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
<font color="#000000">   7:</font>    <font color="#0099ff"><strong>print</strong></font> <font color="#ff00cc">&quot;</font><font color="#ff00cc">&lt;</font><font color="#ff00cc">/</font><font color="#9900cc">${</font><font color="#9900cc">tagName</font><font color="#9900cc">}</font><font color="#ff00cc">&gt;</font><font color="#ff00cc">&quot;</font>
<font color="#000000">   8:</font>    
<font color="#000000">   9:</font><font color="#006699"><strong>def</strong></font> html<font color="#000000"><strong>(</strong></font>block <font color="#006699"><strong>as</strong></font> Block<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
<font color="#990066">  10:</font>    blockTag<font color="#000000"><strong>(</strong></font><font color="#ff00cc">&quot;</font><font color="#ff00cc">html</font><font color="#ff00cc">&quot;</font>, block<font color="#000000"><strong>)</strong></font>
<font color="#000000">  11:</font>    
<font color="#000000">  12:</font><font color="#006699"><strong>def</strong></font> body<font color="#000000"><strong>(</strong></font>block <font color="#006699"><strong>as</strong></font> Block<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
<font color="#000000">  13:</font>    blockTag<font color="#000000"><strong>(</strong></font><font color="#ff00cc">&quot;</font><font color="#ff00cc">body</font><font color="#ff00cc">&quot;</font>, block<font color="#000000"><strong>)</strong></font>
<font color="#000000">  14:</font>
<font color="#990066">  15:</font><font color="#006699"><strong>def</strong></font> text<font color="#000000"><strong>(</strong></font>s <font color="#006699"><strong>as</strong></font> <font color="#009966"><strong>string</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
<font color="#000000">  16:</font>    <font color="#0099ff"><strong>print</strong></font> s
</font></pre>

<p>It works pretty well except that all those <b>do</b> keywords and parenthesis kind of get in the way of clarity for that particular use case.</p>

<p>What we really would like to write is something like:</p>

<pre><font color="#000000"><font color="#000000">   1:</font>html<font color="#000000"><strong>:</strong></font>
<font color="#000000">   2:</font>    body<font color="#000000"><strong>:</strong></font>
<font color="#000000">   3:</font>        text <font color="#ff00cc">&quot;</font><font color="#ff00cc">Hello</font><font color="#ff00cc">,</font><font color="#ff00cc"> </font><font color="#ff00cc">world</font><font color="#ff00cc">!</font><font color="#ff00cc">&quot;</font>
</font></pre>


<p>Which is clearer and more to the point.</p>
<p>Boo actually allows one to do such a thing by extending the language with macros.</p>
<p>Boo macros are objects that are invoked by the compiler during the compilation process to expand or transform the <a href="http://en.wikipedia.org/wiki/Abstract_syntax_tree" target="_blank">AST </a>in a hopefully useful way.</p>
<p>Whenever the Boo parser finds code in the form: <b>name expression_list (block)?</b> it creates a MacroStatement node that will be later handled to a macro object for expansion.</p>
<p>Let's define our <b>html</b>, <b>body</b> and <b>text</b> macros for our DSL:</p>
<pre><font color="#000000"><font color="#000000">   1:</font><font color="#006699"><strong>import</strong></font> Boo.Lang.Compiler
<font color="#000000">   2:</font><font color="#006699"><strong>import</strong></font> Boo.Lang.Compiler.Ast
<font color="#000000">   3:</font>
<font color="#000000">   4:</font><font color="#006699"><strong>class</strong></font> AbstractTagMacro<font color="#000000"><strong>(</strong></font>AbstractAstMacro<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
<font color="#990066">   5:</font><font color="#ff00cc">&quot;&quot;&quot;</font>
<font color="#000000">   6:</font><font color="#ff00cc">Maps</font><font color="#ff00cc"> </font><font color="#ff00cc">a</font><font color="#ff00cc"> </font><font color="#ff00cc">macro</font><font color="#ff00cc"> </font><font color="#ff00cc">to</font><font color="#ff00cc"> </font><font color="#ff00cc">a</font><font color="#ff00cc"> </font><font color="#ff00cc">DSL</font><font color="#ff00cc"> </font><font color="#ff00cc">method</font><font color="#ff00cc"> </font><font color="#ff00cc">invocation</font><font color="#ff00cc">.</font>
<font color="#000000">   7:</font><font color="#ff00cc">&quot;&quot;&quot;</font>
<font color="#000000">   8:</font>    <font color="#006699"><strong>override</strong></font> <font color="#006699"><strong>def</strong></font> Expand<font color="#000000"><strong>(</strong></font>node <font color="#006699"><strong>as</strong></font> MacroStatement<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
<font color="#000000">   9:</font>        invocation <font color="#000000"><strong>=</strong></font> MethodInvocationExpression<font color="#000000"><strong>(</strong></font>Target<font color="#000000"><strong>:</strong></font> ReferenceExpression<font color="#000000"><strong>(</strong></font>TagName<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font>
<font color="#990066">  10:</font>        invocation.Arguments.Add<font color="#000000"><strong>(</strong></font>CallableBlockExpression<font color="#000000"><strong>(</strong></font>Body<font color="#000000"><strong>:</strong></font> node.Block<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font> 
<font color="#000000">  11:</font>        <font color="#006699"><strong>return</strong></font> ExpressionStatement<font color="#000000"><strong>(</strong></font>invocation<font color="#000000"><strong>)</strong></font>
<font color="#000000">  12:</font>        
<font color="#000000">  13:</font>    <font color="#006699"><strong>abstract</strong></font> TagName <font color="#006699"><strong>as</strong></font> <font color="#009966"><strong>string</strong></font><font color="#000000"><strong>:</strong></font>
<font color="#000000">  14:</font>        <font color="#006699"><strong>get</strong></font><font color="#000000"><strong>:</strong></font>
<font color="#990066">  15:</font>            <font color="#006699"><strong>pass</strong></font>
<font color="#000000">  16:</font>
<font color="#000000">  17:</font><font color="#006699"><strong>class</strong></font> HtmlMacro<font color="#000000"><strong>(</strong></font>AbstractTagMacro<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
<font color="#000000">  18:</font>    <font color="#006699"><strong>override</strong></font> TagName<font color="#000000"><strong>:</strong></font>
<font color="#000000">  19:</font>        <font color="#006699"><strong>get</strong></font><font color="#000000"><strong>:</strong></font> <font color="#006699"><strong>return</strong></font> <font color="#ff00cc">&quot;</font><font color="#ff00cc">html</font><font color="#ff00cc">&quot;</font>
<font color="#990066">  20:</font>        
<font color="#000000">  21:</font><font color="#006699"><strong>class</strong></font> BodyMacro<font color="#000000"><strong>(</strong></font>AbstractTagMacro<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
<font color="#000000">  22:</font>    <font color="#006699"><strong>override</strong></font> TagName<font color="#000000"><strong>:</strong></font>
<font color="#000000">  23:</font>        <font color="#006699"><strong>get</strong></font><font color="#000000"><strong>:</strong></font> <font color="#006699"><strong>return</strong></font> <font color="#ff00cc">&quot;</font><font color="#ff00cc">body</font><font color="#ff00cc">&quot;</font>
<font color="#000000">  24:</font>        
<font color="#990066">  25:</font><font color="#006699"><strong>class</strong></font> TextMacro<font color="#000000"><strong>(</strong></font>AbstractAstMacro<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
<font color="#000000">  26:</font>    <font color="#006699"><strong>override</strong></font> <font color="#006699"><strong>def</strong></font> Expand<font color="#000000"><strong>(</strong></font>node <font color="#006699"><strong>as</strong></font> MacroStatement<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
<font color="#000000">  27:</font>        invocation <font color="#000000"><strong>=</strong></font> MethodInvocationExpression<font color="#000000"><strong>(</strong></font>Target<font color="#000000"><strong>:</strong></font> ReferenceExpression<font color="#000000"><strong>(</strong></font><font color="#ff00cc">&quot;</font><font color="#ff00cc">text</font><font color="#ff00cc">&quot;</font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font>
<font color="#000000">  28:</font>        invocation.Arguments <font color="#000000"><strong>=</strong></font> node.Arguments
<font color="#000000">  29:</font>        <font color="#006699"><strong>return</strong></font> ExpressionStatement<font color="#000000"><strong>(</strong></font>invocation<font color="#000000"><strong>)</strong></font>
</font></pre>
<p>
Now we can write code as we wanted to in the first place but there are a few issues with macros:
<ul>
<li>writing macros demand a in depth knowledge of the compiler object model (oh, you didn't notice it?)</li>
<li>macros cannot be used in the same assembly defining them (the compiler needs to instantiate them after all, right?)</li>
</ul>
</p>

<p>Enter <a href="http://jira.codehaus.org/browse/BOO-835" target="_blank">BOO-835</a>. It's now possible to use regular method definitions to create DSLs:</p>
<pre><font color="#000000"><font color="#000000">   1:</font><font color="#006699"><strong>callable</strong></font> Block<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
<font color="#000000">   2:</font>
<font color="#000000">   3:</font><font color="#006699"><strong>def</strong></font> blockTag<font color="#000000"><strong>(</strong></font>tagName <font color="#006699"><strong>as</strong></font> <font color="#009966"><strong>string</strong></font>, block <font color="#006699"><strong>as</strong></font> Block<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
<font color="#000000">   4:</font>    <font color="#0099ff"><strong>print</strong></font> <font color="#ff00cc">&quot;</font><font color="#ff00cc">&lt;</font><font color="#9900cc">${</font><font color="#9900cc">tagName</font><font color="#9900cc">}</font><font color="#ff00cc">&gt;</font><font color="#ff00cc">&quot;</font>
<font color="#990066">   5:</font>    block<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
<font color="#000000">   6:</font>    <font color="#0099ff"><strong>print</strong></font> <font color="#ff00cc">&quot;</font><font color="#ff00cc">&lt;</font><font color="#ff00cc">/</font><font color="#9900cc">${</font><font color="#9900cc">tagName</font><font color="#9900cc">}</font><font color="#ff00cc">&gt;</font><font color="#ff00cc">&quot;</font>
<font color="#000000">   7:</font>    
<font color="#000000">   8:</font><font color="#006699"><strong>def</strong></font> html<font color="#000000"><strong>(</strong></font>block <font color="#006699"><strong>as</strong></font> Block<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
<font color="#000000">   9:</font>    blockTag <font color="#ff00cc">&quot;</font><font color="#ff00cc">html</font><font color="#ff00cc">&quot;</font>, block
<font color="#990066">  10:</font>    
<font color="#000000">  11:</font><font color="#006699"><strong>def</strong></font> body<font color="#000000"><strong>(</strong></font>block <font color="#006699"><strong>as</strong></font> Block<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
<font color="#000000">  12:</font>    blockTag <font color="#ff00cc">&quot;</font><font color="#ff00cc">body</font><font color="#ff00cc">&quot;</font>, block
<font color="#000000">  13:</font>    
<font color="#000000">  14:</font><font color="#006699"><strong>def</strong></font> text<font color="#000000"><strong>(</strong></font>s <font color="#006699"><strong>as</strong></font> <font color="#009966"><strong>string</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>:</strong></font>
<font color="#990066">  15:</font>    <font color="#0099ff"><strong>print</strong></font> s
<font color="#000000">  16:</font>    
<font color="#000000">  17:</font>html<font color="#000000"><strong>:</strong></font>
<font color="#000000">  18:</font>    body<font color="#000000"><strong>:</strong></font>
<font color="#000000">  19:</font>        text <font color="#ff00cc">&quot;</font><font color="#ff00cc">Hello</font><font color="#ff00cc">,</font><font color="#ff00cc"> </font><font color="#ff00cc">world</font><font color="#ff00cc">!</font><font color="#ff00cc">&quot;</font>
</font></pre>

<p>The code landed in the repository just a few minutes ago so feel free to try it while it's hot.</p>
<p></p>
<p><b>Updated: jira issue code was wrong.</b></p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-06-07T01:01:05-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001587_monster_muck_mashup.html">
<title>Monster Muck Mashup</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001587_monster_muck_mashup.html</link>
<description><![CDATA[<p>I am <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=691&categoryID=100" target="_blank">impressed</a>.</p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-06-05T13:24:08-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001586_domain_model_persistence_on_the_naked_clr.html">
<title>Domain model persistence on the naked CLR</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001586_domain_model_persistence_on_the_naked_clr.html</link>
<description><![CDATA[<p><a href="http://ayende.com/Blog/Default.aspx">Oren</a> <a href="http://ayende.com/Blog/archive/2007/06/03/Domain-Driven-on-Naked-CLR.aspx">asks</a>: </p>

<p>&nbsp;&nbsp;&nbsp;"Assuming that you have no access to tooling, and you don't have the resources to built NHibernate-sque framework, how would you approach building a Domain Driven application on the naked CLR?"</p>

<p>The most interesting part of the question for me is <i>"and you don't have the resources to built NHibernate" </i>because it immediately goes to the seemingly basic assumption most people have these days that "Persistence => SQL". <br />
	 <br />
While it might be certainly true that a relational backend is a given for most enterprisey scenarios it is certainly not true that all persistent applications have to go through the pain. </p>

<p>Once upon a time a team with 4 people (2 developers, 2 web designers) built the web content management system for the 3rd largest TV station in Brazil on top of System.Runtime.Serialization using the <a href="http://en.wikipedia.org/wiki/Object_Prevalence">Object Prevalence</a> architecture.</p>

<p>Yeah, skin naked CLR.</p>

<p>If your specific application can't afford keeping all its objects in memory all the time and you don't mind putting a little clothes on, there's <a href="http://www.db4o.com/" target="_blank">db4o</a>.</p>

<p></p>

<p><br />
 </p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-06-03T11:48:05-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001580_did_i_say_10x_improvement.html">
<title>Did I say 10x improvement?</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001580_did_i_say_10x_improvement.html</link>
<description><![CDATA[<p>
I've applied the same <a href="http://blogs.codehaus.org/people/bamboo/archives/001578_10x_improvement_for_dynamic_dispatching_or_how_it_took_me_4_years_to_optimize_duck_typing.html">optimization technique</a> to static method and binary operator dispatching and now we have:
</p>
<pre style="background-color: black; color: white;">
int*int: 1.1115984

list*int: 5.0773008

dynamicDispatch: 4.2661344

staticDispatch 1.4921456
</pre>
<p>Niiiice.</p>
<p>Changes checked in by the way.</p>]]></description>
<dc:subject></dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-05-22T03:28:49-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001578_10x_improvement_for_dynamic_dispatching_or_how_it_took_me_4_years_to_optimize_duck_typing.html">
<title>10x improvement for dynamic dispatching OR how it took me 4 years to optimize duck typing</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001578_10x_improvement_for_dynamic_dispatching_or_how_it_took_me_4_years_to_optimize_duck_typing.html</link>
<description><![CDATA[<p>
Around 4 years ago (!) there was <a href="http://lists.ximian.com/pipermail/mono-devel-list/2003-September/002143.html">this discussion</a> about how to support some dynamic language features on top of mono. One of the topics was optimizing dynamic dispatching and apparently <a href="http://lists.ximian.com/pipermail/mono-devel-list/2003-September/002151.html">my suggestion</a> was  redirected to nul.
</p><p>
4 years later here I am finally implementing the idea in order to take boo's dynamic dispatching performance to the next level.
</p><p>
Before the optimization:
</p><pre style="background-color: black; color: white;">$ build/booi performance/duckoperators.boo
int*int: 1.101584
list*int: 29.0217312
dynamicDispatch: 51.9484224
staticDispatch 1.4921456
</pre><p>
Each line reports how long it takes to execute the described operation with dynamic dispatching 5_000_000 times (except the last line which executes the same operation as the line before it but with static dispatching).
</p><p>
The first line tells us that it takes 1.10 seconds for boo to multiply two integer objects using dynamic dispatching.
<br />The second line says boo takes 29.02 seconds to multiply a List instance by an integer using dynamic dispatching (dynamic dispatch over static methods).
<br />The third line which is the most interesting one for our purposes here says that boo takes roughly 52 seconds to dynamically dispatch 5_000_000 instance method calls.
</p><p>
We can see a huge overhead over static dispatching.
</p><p>
After the optimization:
</p><pre style="background-color: black; color: white;">$ build/booi performance/duckoperators.boo
int*int: 1.101584
list*int: 27.755072
dynamicDispatch: 4.055832
staticDispatch 1.4821312
</pre><p>
Niiiiiice.
</p><p>
So this first stab got it from <strong>52 seconds</strong> down to <strong>4 seconds</strong>. Not bad at all. A few changes and we'll have the same benefits for dynamic dispatching over static methods.
</p><p>
I hope this will have a huge impact on environments that rely heavily on dynamic dispatching such as <a href="http://wiki.castleproject.org/index.php/MonoRail:Brail">Brail</a>.
</p><p>
