<?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 a universe of natural selection&quot;</description>
<dc:language>en-us</dc:language>
<dc:creator></dc:creator>
<dc:date>2009-02-27T15:46:08-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/001770_boo_is_now_available_as_a_programming_language_for_sourceforge_projects.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001760_environment_based_programming_design_pattern.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001759_experience_boojay_with_monolipse_followup_ii_working_on_windows.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001752_experience_boojay_with_monolipse_follow_up.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001751_experience_boojay_with_monolipse.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001750_boo_09_introducing_type_member_macros.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001749_boo_09_is_here.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/bamboo/archives/001722_boo_ometa_and_extensible_parsing_i.html" />
<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/001770_boo_is_now_available_as_a_programming_language_for_sourceforge_projects.html">
<title>Boo is now available as a Programming Language for SourceForge projects</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001770_boo_is_now_available_as_a_programming_language_for_sourceforge_projects.html</link>
<description><![CDATA[<p>After <a href="https://sourceforge.net/tracker2/?func=detail&amp;atid=350001&amp;aid=1122540&amp;group_id=1">a long wait</a> <a href="http://boo.codehaus.org/">boo</a> is finally available as <a href="https://sourceforge.net/softwaremap/trove_list.php?form_cat=839">a programming language category</a> on Source Forge.</p>
<p>Now go and improve the categorization of your boo projects.</p>
]]></description>
<dc:subject></dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2009-02-27T15:46:08-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001760_environment_based_programming_design_pattern.html">
<title>Environment Based Programming Design Pattern</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001760_environment_based_programming_design_pattern.html</link>
<description><![CDATA[<p><strong>Motivations</strong>:</p>
<ul>
  <li>You want to decouple the different components of a system;</li>

  <li>You want to minimize the scope of their dependencies;</li>

  <li>You are developing a system that needs to support dynamic reconfigurability;</li>

  <li>You want a simple programming model that stirs you in the direction of better dependency management.</li>
</ul>
<p>Environment Based Programming* is a design pattern founded on a very simple principle:</p>
<ul>
  <li><strong><span style="font-weight: normal;"><strong>Code</strong> executes in an <strong>environment</strong> that <strong>provides</strong> it with all its <strong>needs</strong>.</span><br /></strong></li>
</ul>
<p><span style="font-weight: normal;">This principle can be completely captured in C# with the following API:</span></p>
<pre>
    <font color="#009966"><strong>namespace</strong></font> EnvironmentBasedProgramming
    <font color="#000000"><strong>{</strong></font>
        <font color="#006699"><strong>public</strong></font> <font color="#006699"><strong>delegate</strong></font> <font color="#0099FF"><strong>void</strong></font> <font color="#9966FF">Code</font>()<font color="#000000"><strong>;</strong></font>
    
        <font color="#006699"><strong>public</strong></font> <font color="#0099FF"><strong>interface</strong></font> IEnvironment
        <font color="#000000"><strong>{</strong></font>
            Need Provide<font color="#000000"><strong>&lt;</strong></font>Need<font color="#000000"><strong>&gt;</strong></font>()<font color="#000000"><strong>;</strong></font>
        <font color="#000000"><strong>}</strong></font>
    
        <font color="#006699"><strong>public</strong></font> <font color="#006699"><strong>static</strong></font> <font color="#0099FF"><strong>class</strong></font> Environments
        <font color="#000000"><strong>{</strong></font>   
            <font color="#6600CC">///</font><font color="#6600CC"> </font><font color="#0000FF">&lt;</font><font color="#0000FF">summary</font><font color="#0000FF">&gt;</font>
            <font color="#6600CC">///</font><font color="#6600CC"> </font><font color="#6600CC">Executes</font><font color="#6600CC"> </font><font color="#6600CC">code</font><font color="#6600CC"> </font><font color="#6600CC">in</font><font color="#6600CC"> </font><font color="#6600CC">a</font><font color="#6600CC"> </font><font color="#6600CC">given</font><font color="#6600CC"> </font><font color="#6600CC">environment</font><font color="#6600CC">.</font>
            <font color="#6600CC">///</font><font color="#6600CC"> </font><font color="#0000FF">&lt;</font><font color="#0000FF">/</font><font color="#0000FF">summary</font><font color="#0000FF">&gt;</font>
            <font color="#006699"><strong>public</strong></font> <font color="#006699"><strong>static</strong></font> <font color="#0099FF"><strong>void</strong></font> <font color="#9966FF">With</font>(IEnvironment environment<font color="#000000"><strong>,</strong></font> Code code)<font color="#000000"><strong>;</strong></font>
        <font color="#000000"><strong>}</strong></font>
    
        <font color="#6600CC">///</font><font color="#6600CC"> </font><font color="#0000FF">&lt;</font><font color="#0000FF">summary</font><font color="#0000FF">&gt;</font>
        <font color="#6600CC">///</font><font color="#6600CC"> </font><font color="#6600CC">Used</font><font color="#6600CC"> </font><font color="#6600CC">by</font><font color="#6600CC"> </font><font color="#6600CC">code</font><font color="#6600CC"> </font><font color="#6600CC">to</font><font color="#6600CC"> </font><font color="#6600CC">fulfill</font><font color="#6600CC"> </font><font color="#6600CC">its</font><font color="#6600CC"> </font><font color="#6600CC">needs</font><font color="#6600CC">.</font>
        <font color="#6600CC">///</font><font color="#6600CC"> </font><font color="#0000FF">&lt;</font><font color="#0000FF">/</font><font color="#0000FF">summary</font><font color="#0000FF">&gt;</font>
        <font color="#006699"><strong>public</strong></font> <font color="#006699"><strong>static</strong></font> <font color="#0099FF"><strong>class</strong></font> My<font color="#000000"><strong>&lt;</strong></font>Need<font color="#000000"><strong>&gt;</strong></font>
        <font color="#000000"><strong>{</strong></font>
            <font color="#006699"><strong>public</strong></font> <font color="#006699"><strong>static</strong></font> Need Instance <font color="#000000"><strong>{</strong></font> get<font color="#000000"><strong>;</strong></font> <font color="#000000"><strong>}</strong></font>
        <font color="#000000"><strong>}</strong></font>
    <font color="#000000"><strong>}</strong></font>
</pre>
<p>To make it all concrete I'll use <a href="http://martinfowler.com/articles/injection.html#ANaiveExample">Martin Fowler's naive example</a> specially for the contrast with the dependency management approaches he documents in his article. The MovieLister component provides a list of movies directed by a particular director. In order to fulfill its contract it needs the list of all known movies, something that a MovieFinder service would provide:<br /></p>
<pre>
    <font color="#0099FF"><strong>interface</strong></font> IMovieFinder
    <font color="#000000"><strong>{</strong></font>
        IEnumerable<font color="#000000"><strong>&lt;</strong></font>Movie<font color="#000000"><strong>&gt;</strong></font> <font color="#9966FF">FindAll</font>()<font color="#000000"><strong>;</strong></font>
    <font color="#000000"><strong>}</strong></font>
    
    <font color="#0099FF"><strong>class</strong></font> MovieLister
    <font color="#000000"><strong>{</strong></font>
        <font color="#006699"><strong>public</strong></font> IEnumerable<font color="#000000"><strong>&lt;</strong></font>Movie<font color="#000000"><strong>&gt;</strong></font> <font color="#9966FF">MoviesDirectedBy</font>(<font color="#0099FF"><strong>string</strong></font> directorName)
        <font color="#000000"><strong>{</strong></font>
            var movies <font color="#000000"><strong>=</strong></font> My<font color="#000000"><strong>&lt;</strong></font>IMovieFinder<font color="#000000"><strong>&gt;</strong></font><font color="#000000"><strong>.</strong></font>Instance<font color="#000000"><strong>.</strong></font><font color="#9966FF">FindAll</font>()<font color="#000000"><strong>;</strong></font>
            <font color="#006699"><strong>foreach</strong></font> (var movie <font color="#006699"><strong>in</strong></font> movies)
                <font color="#006699"><strong>if</strong></font> (movie<font color="#000000"><strong>.</strong></font>Director <font color="#000000"><strong>=</strong></font><font color="#000000"><strong>=</strong></font> directorName)
                    yield <font color="#006699"><strong>return</strong></font> movie<font color="#000000"><strong>;</strong></font>
        <font color="#000000"><strong>}</strong></font>
    <font color="#000000"><strong>}</strong></font>
</pre>
<p>Notice how the code express its needs using the <strong>My</strong> idiom.</p>
<p>MovieLister can now be executed in a suitable environment using the <strong>With</strong> primitive:</p>
<pre>
    Environments<font color="#000000"><strong>.</strong></font><font color="#9966FF">With</font>(environment<font color="#000000"><strong>,</strong></font> <font color="#006699"><strong>delegate</strong></font>
    <font color="#000000"><strong>{</strong></font>
        <font color="#006699"><strong>foreach</strong></font> (var movie <font color="#006699"><strong>in</strong></font> <font color="#006699"><strong>new</strong></font> <font color="#9966FF">MovieLister</font>()<font color="#000000"><strong>.</strong></font><font color="#9966FF">MoviesDirectedBy</font>(<font color="#FF00CC">"</font><font color="#FF00CC">Terry</font><font color="#FF00CC"> </font><font color="#FF00CC">Jones</font><font color="#FF00CC">"</font>))
            Console<font color="#000000"><strong>.</strong></font><font color="#9966FF">WriteLine</font>(movie<font color="#000000"><strong>.</strong></font>Title)<font color="#000000"><strong>;</strong></font>
    <font color="#000000"><strong>}</strong></font>)<font color="#000000"><strong>;</strong></font>
</pre>
<p>A suitable environment in this case would have to deliver a valid IMoveFinder instance upon request. The following implementation should suffice:</p>
<pre>
    <font color="#0099FF"><strong>class</strong></font> DummyMovieFinder <font color="#000000"><strong>:</strong></font> IMovieFinder
    <font color="#000000"><strong>{</strong></font>   
        <font color="#006699"><strong>public</strong></font> IEnumerable<font color="#000000"><strong>&lt;</strong></font>Movie<font color="#000000"><strong>&gt;</strong></font> <font color="#9966FF">FindAll</font>()
        <font color="#000000"><strong>{</strong></font>
            yield <font color="#006699"><strong>return</strong></font> <font color="#006699"><strong>new</strong></font> Movie <font color="#000000"><strong>{</strong></font>Director <font color="#000000"><strong>=</strong></font> <font color="#FF00CC">"</font><font color="#FF00CC">Terry</font><font color="#FF00CC"> </font><font color="#FF00CC">Jones</font><font color="#FF00CC">"</font><font color="#000000"><strong>,</strong></font> Title <font color="#000000"><strong>=</strong></font> <font color="#FF00CC">"</font><font color="#FF00CC">Erik</font><font color="#FF00CC"> </font><font color="#FF00CC">The</font><font color="#FF00CC"> </font><font color="#FF00CC">Viking</font><font color="#FF00CC">"</font><font color="#000000"><strong>}</strong></font><font color="#000000"><strong>;</strong></font>
            yield <font color="#006699"><strong>return</strong></font> <font color="#006699"><strong>new</strong></font> Movie <font color="#000000"><strong>{</strong></font>Director <font color="#000000"><strong>=</strong></font> <font color="#FF00CC">"</font><font color="#FF00CC">Terry</font><font color="#FF00CC"> </font><font color="#FF00CC">Gilliam</font><font color="#FF00CC">"</font><font color="#000000"><strong>,</strong></font> Title <font color="#000000"><strong>=</strong></font> <font color="#FF00CC">"</font><font color="#FF00CC">Fear</font><font color="#FF00CC"> </font><font color="#FF00CC">and</font><font color="#FF00CC"> </font><font color="#FF00CC">Loathing</font><font color="#FF00CC"> </font><font color="#FF00CC">in</font><font color="#FF00CC"> </font><font color="#FF00CC">Las</font><font color="#FF00CC"> </font><font color="#FF00CC">Vegas</font><font color="#FF00CC">"</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>
</pre>
<p>The missing piece in the puzzle is the final EBP building block - <strong>ClosedEnvironment</strong>:</p>
<pre>
    <font color="#006699"><strong>public</strong></font> <font color="#0099FF"><strong>class</strong></font> ClosedEnvironment <font color="#000000"><strong>:</strong></font> IEnvironment
    <font color="#000000"><strong>{</strong></font>
        <font color="#006699"><strong>private</strong></font> <font color="#006699"><strong>readonly</strong></font> <font color="#0099FF"><strong>object</strong></font><font color="#000000"><strong>[</strong></font><font color="#000000"><strong>]</strong></font> _bindings<font color="#000000"><strong>;</strong></font>

        <font color="#006699"><strong>public</strong></font> <font color="#9966FF">ClosedEnvironment</font>(<font color="#006699"><strong>params</strong></font> <font color="#0099FF"><strong>object</strong></font><font color="#000000"><strong>[</strong></font><font color="#000000"><strong>]</strong></font> bindings)
        <font color="#000000"><strong>{</strong></font>
            _bindings <font color="#000000"><strong>=</strong></font> bindings<font color="#000000"><strong>;</strong></font>
        <font color="#000000"><strong>}</strong></font>
        
        <font color="#006699"><strong>public</strong></font> T Provide<font color="#000000"><strong>&lt;</strong></font>T<font color="#000000"><strong>&gt;</strong></font>()
        <font color="#000000"><strong>{</strong></font>
            <font color="#006699"><strong>foreach</strong></font> (var binding <font color="#006699"><strong>in</strong></font> _bindings)
                <font color="#006699"><strong>if</strong></font> (binding <font color="#006699"><strong>is</strong></font> T)
                    <font color="#006699"><strong>return</strong></font> (T) binding<font color="#000000"><strong>;</strong></font>
            <font color="#006699"><strong>return</strong></font> <font color="#006699"><strong>default</strong></font>(T)<font color="#000000"><strong>;</strong></font>
        <font color="#000000"><strong>}</strong></font>
    <font color="#000000"><strong>}</strong></font>
</pre>
<p>Which allows the environment for the example to be defined as:</p>
<pre>
    var environment <font color="#000000"><strong>=</strong></font> <font color="#006699"><strong>new</strong></font> <font color="#9966FF">ClosedEnvironment</font>(<font color="#006699"><strong>new</strong></font> <font color="#9966FF">DummyMovieFinder</font>())<font color="#000000"><strong>;</strong></font>
</pre>
<p>Component activation and lifetime are not aspects dealt directly with by EBP and are better treated as different environment strategies (one can easily imagine an environment that automatically instantiates components based on naming conventions or metadata).</p>
<p>The complete listings follow.</p>
<p>The example:</p>
<pre>
    <font color="#009966"><strong>namespace</strong></font> EnvironmentBasedProgramming<font color="#000000"><strong>.</strong></font>NaiveExample
    <font color="#000000"><strong>{</strong></font>
        <font color="#009966"><strong>using</strong></font> System<font color="#000000"><strong>;</strong></font>
        <font color="#009966"><strong>using</strong></font> System<font color="#000000"><strong>.</strong></font>Collections<font color="#000000"><strong>.</strong></font>Generic<font color="#000000"><strong>;</strong></font>
    
        <font color="#0099FF"><strong>class</strong></font> Movie
        <font color="#000000"><strong>{</strong></font>
            <font color="#006699"><strong>public</strong></font> <font color="#0099FF"><strong>string</strong></font> Title <font color="#000000"><strong>{</strong></font> get<font color="#000000"><strong>;</strong></font> set<font color="#000000"><strong>;</strong></font> <font color="#000000"><strong>}</strong></font>
            <font color="#006699"><strong>public</strong></font> <font color="#0099FF"><strong>string</strong></font> Director <font color="#000000"><strong>{</strong></font> get<font color="#000000"><strong>;</strong></font> set<font color="#000000"><strong>;</strong></font> <font color="#000000"><strong>}</strong></font>
        <font color="#000000"><strong>}</strong></font>
    
        <font color="#0099FF"><strong>interface</strong></font> IMovieFinder
        <font color="#000000"><strong>{</strong></font>
            IEnumerable<font color="#000000"><strong>&lt;</strong></font>Movie<font color="#000000"><strong>&gt;</strong></font> <font color="#9966FF">FindAll</font>()<font color="#000000"><strong>;</strong></font>
        <font color="#000000"><strong>}</strong></font>
    
        <font color="#0099FF"><strong>class</strong></font> MovieLister
        <font color="#000000"><strong>{</strong></font>
            <font color="#006699"><strong>public</strong></font> IEnumerable<font color="#000000"><strong>&lt;</strong></font>Movie<font color="#000000"><strong>&gt;</strong></font> <font color="#9966FF">MoviesDirectedBy</font>(<font color="#0099FF"><strong>string</strong></font> directorName)
            <font color="#000000"><strong>{</strong></font>
                var movies <font color="#000000"><strong>=</strong></font> My<font color="#000000"><strong>&lt;</strong></font>IMovieFinder<font color="#000000"><strong>&gt;</strong></font><font color="#000000"><strong>.</strong></font>Instance<font color="#000000"><strong>.</strong></font><font color="#9966FF">FindAll</font>()<font color="#000000"><strong>;</strong></font>
                <font color="#006699"><strong>foreach</strong></font> (var movie <font color="#006699"><strong>in</strong></font> movies)
                    <font color="#006699"><strong>if</strong></font> (movie<font color="#000000"><strong>.</strong></font>Director <font color="#000000"><strong>=</strong></font><font color="#000000"><strong>=</strong></font> directorName)
                        yield <font color="#006699"><strong>return</strong></font> movie<font color="#000000"><strong>;</strong></font>
            <font color="#000000"><strong>}</strong></font>
        <font color="#000000"><strong>}</strong></font>
    
        <font color="#0099FF"><strong>class</strong></font> Program
        <font color="#000000"><strong>{</strong></font>
            <font color="#006699"><strong>static</strong></font> <font color="#0099FF"><strong>void</strong></font> <font color="#9966FF">Main</font>(<font color="#0099FF"><strong>string</strong></font><font color="#000000"><strong>[</strong></font><font color="#000000"><strong>]</strong></font> args)
            <font color="#000000"><strong>{</strong></font>
                var environment <font color="#000000"><strong>=</strong></font> <font color="#006699"><strong>new</strong></font> <font color="#9966FF">ClosedEnvironment</font>(<font color="#006699"><strong>new</strong></font> <font color="#9966FF">DummyMovieFinder</font>())<font color="#000000"><strong>;</strong></font>
                Environments<font color="#000000"><strong>.</strong></font><font color="#9966FF">With</font>(environment<font color="#000000"><strong>,</strong></font> <font color="#006699"><strong>delegate</strong></font>
                <font color="#000000"><strong>{</strong></font>
                    <font color="#9966FF">PrintMoviesDirectedBy</font>(<font color="#FF00CC">"</font><font color="#FF00CC">Terry</font><font color="#FF00CC"> </font><font color="#FF00CC">Jones</font><font color="#FF00CC">"</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>private</strong></font> <font color="#006699"><strong>static</strong></font> <font color="#0099FF"><strong>void</strong></font> <font color="#9966FF">PrintMoviesDirectedBy</font>(<font color="#0099FF"><strong>string</strong></font> directorName)
            <font color="#000000"><strong>{</strong></font>
                <font color="#006699"><strong>foreach</strong></font> (var movie <font color="#006699"><strong>in</strong></font> <font color="#006699"><strong>new</strong></font> <font color="#9966FF">MovieLister</font>()<font color="#000000"><strong>.</strong></font><font color="#9966FF">MoviesDirectedBy</font>(directorName))
                    Console<font color="#000000"><strong>.</strong></font><font color="#9966FF">WriteLine</font>(movie<font color="#000000"><strong>.</strong></font>Title)<font color="#000000"><strong>;</strong></font>
            <font color="#000000"><strong>}</strong></font>
    
            <font color="#0099FF"><strong>class</strong></font> DummyMovieFinder <font color="#000000"><strong>:</strong></font> IMovieFinder
            <font color="#000000"><strong>{</strong></font>   
                <font color="#006699"><strong>public</strong></font> IEnumerable<font color="#000000"><strong>&lt;</strong></font>Movie<font color="#000000"><strong>&gt;</strong></font> <font color="#9966FF">FindAll</font>()
                <font color="#000000"><strong>{</strong></font>
                    yield <font color="#006699"><strong>return</strong></font> <font color="#006699"><strong>new</strong></font> Movie <font color="#000000"><strong>{</strong></font>Director <font color="#000000"><strong>=</strong></font> <font color="#FF00CC">"</font><font color="#FF00CC">Terry</font><font color="#FF00CC"> </font><font color="#FF00CC">Jones</font><font color="#FF00CC">"</font><font color="#000000"><strong>,</strong></font> Title <font color="#000000"><strong>=</strong></font> <font color="#FF00CC">"</font><font color="#FF00CC">Erik</font><font color="#FF00CC"> </font><font color="#FF00CC">The</font><font color="#FF00CC"> </font><font color="#FF00CC">Viking</font><font color="#FF00CC">"</font><font color="#000000"><strong>}</strong></font><font color="#000000"><strong>;</strong></font>
                    yield <font color="#006699"><strong>return</strong></font> <font color="#006699"><strong>new</strong></font> Movie <font color="#000000"><strong>{</strong></font>Director <font color="#000000"><strong>=</strong></font> <font color="#FF00CC">"</font><font color="#FF00CC">Terry</font><font color="#FF00CC"> </font><font color="#FF00CC">Gilliam</font><font color="#FF00CC">"</font><font color="#000000"><strong>,</strong></font> Title <font color="#000000"><strong>=</strong></font> <font color="#FF00CC">"</font><font color="#FF00CC">Fear</font><font color="#FF00CC"> </font><font color="#FF00CC">and</font><font color="#FF00CC"> </font><font color="#FF00CC">Loathing</font><font color="#FF00CC"> </font><font color="#FF00CC">in</font><font color="#FF00CC"> </font><font color="#FF00CC">Las</font><font color="#FF00CC"> </font><font color="#FF00CC">Vegas</font><font color="#FF00CC">"</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>
</pre>
<p>The minimalist EBP framework written for this article:</p>
<pre>
    <font color="#009966"><strong>namespace</strong></font> EnvironmentBasedProgramming
    <font color="#000000"><strong>{</strong></font>
        <font color="#009966"><strong>using</strong></font> System<font color="#000000"><strong>;</strong></font>
    
        <font color="#006699"><strong>public</strong></font> <font color="#006699"><strong>delegate</strong></font> <font color="#0099FF"><strong>void</strong></font> <font color="#9966FF">Code</font>()<font color="#000000"><strong>;</strong></font>
    
        <font color="#006699"><strong>public</strong></font> <font color="#0099FF"><strong>interface</strong></font> IEnvironment
        <font color="#000000"><strong>{</strong></font>
            Need Provide<font color="#000000"><strong>&lt;</strong></font>Need<font color="#000000"><strong>&gt;</strong></font>()<font color="#000000"><strong>;</strong></font>
        <font color="#000000"><strong>}</strong></font>
    
        <font color="#006699"><strong>public</strong></font> <font color="#006699"><strong>static</strong></font> <font color="#0099FF"><strong>class</strong></font> Environments
        <font color="#000000"><strong>{</strong></font>   
            <font color="#6600CC">///</font><font color="#6600CC"> </font><font color="#0000FF">&lt;</font><font color="#0000FF">summary</font><font color="#0000FF">&gt;</font>
            <font color="#6600CC">///</font><font color="#6600CC"> </font><font color="#6600CC">Executes</font><font color="#6600CC"> </font><font color="#6600CC">code</font><font color="#6600CC"> </font><font color="#6600CC">in</font><font color="#6600CC"> </font><font color="#6600CC">a</font><font color="#6600CC"> </font><font color="#6600CC">given</font><font color="#6600CC"> </font><font color="#6600CC">environment</font><font color="#6600CC">.</font>
            <font color="#6600CC">///</font><font color="#6600CC"> </font><font color="#0000FF">&lt;</font><font color="#0000FF">/</font><font color="#0000FF">summary</font><font color="#0000FF">&gt;</font>
            <font color="#006699"><strong>public</strong></font> <font color="#006699"><strong>static</strong></font> <font color="#0099FF"><strong>void</strong></font> <font color="#9966FF">With</font>(IEnvironment environment<font color="#000000"><strong>,</strong></font> Code code)
            <font color="#000000"><strong>{</strong></font>
                IEnvironment previous <font color="#000000"><strong>=</strong></font> _environment<font color="#000000"><strong>;</strong></font>
                _environment <font color="#000000"><strong>=</strong></font> environment<font color="#000000"><strong>;</strong></font>
                <font color="#006699"><strong>try</strong></font>
                <font color="#000000"><strong>{</strong></font>
                    <font color="#9966FF">code</font>()<font color="#000000"><strong>;</strong></font>
                <font color="#000000"><strong>}</strong></font>
                <font color="#006699"><strong>finally</strong></font>
                <font color="#000000"><strong>{</strong></font>
                    _environment <font color="#000000"><strong>=</strong></font> previous<font color="#000000"><strong>;</strong></font>
                <font color="#000000"><strong>}</strong></font>
            <font color="#000000"><strong>}</strong></font>
    
            <font color="#006699"><strong>private</strong></font> <font color="#006699"><strong>static</strong></font> IEnvironment _environment<font color="#000000"><strong>;</strong></font>
    
            <font color="#006699"><strong>internal</strong></font> <font color="#006699"><strong>static</strong></font> IEnvironment Current
            <font color="#000000"><strong>{</strong></font>
                get <font color="#000000"><strong>{</strong></font> <font color="#006699"><strong>return</strong></font> _environment<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="#6600CC">///</font><font color="#6600CC"> </font><font color="#0000FF">&lt;</font><font color="#0000FF">summary</font><font color="#0000FF">&gt;</font>
        <font color="#6600CC">///</font><font color="#6600CC"> </font><font color="#6600CC">Used</font><font color="#6600CC"> </font><font color="#6600CC">by</font><font color="#6600CC"> </font><font color="#6600CC">code</font><font color="#6600CC"> </font><font color="#6600CC">to</font><font color="#6600CC"> </font><font color="#6600CC">fulfill</font><font color="#6600CC"> </font><font color="#6600CC">its</font><font color="#6600CC"> </font><font color="#6600CC">needs</font><font color="#6600CC">.</font>
        <font color="#6600CC">///</font><font color="#6600CC"> </font><font color="#0000FF">&lt;</font><font color="#0000FF">/</font><font color="#0000FF">summary</font><font color="#0000FF">&gt;</font>
        <font color="#006699"><strong>public</strong></font> <font color="#006699"><strong>static</strong></font> <font color="#0099FF"><strong>class</strong></font> My<font color="#000000"><strong>&lt;</strong></font>Need<font color="#000000"><strong>&gt;</strong></font>
        <font color="#000000"><strong>{</strong></font>
            <font color="#006699"><strong>public</strong></font> <font color="#006699"><strong>static</strong></font> Need Instance
            <font color="#000000"><strong>{</strong></font>
                get
                <font color="#000000"><strong>{</strong></font>
                    var current <font color="#000000"><strong>=</strong></font> Environments<font color="#000000"><strong>.</strong></font>Current<font color="#000000"><strong>;</strong></font>
                    <font color="#006699"><strong>if</strong></font> (current <font color="#000000"><strong>=</strong></font><font color="#000000"><strong>=</strong></font> <font color="#CC00CC">null</font>)
                        <font color="#006699"><strong>throw</strong></font> <font color="#006699"><strong>new</strong></font> <font color="#9966FF">InvalidOperationException</font>(<font color="#FF00CC">"</font><font color="#FF00CC">No</font><font color="#FF00CC"> </font><font color="#FF00CC">environment</font><font color="#FF00CC"> </font><font color="#FF00CC">to</font><font color="#FF00CC"> </font><font color="#FF00CC">provide</font><font color="#FF00CC"> </font><font color="#FF00CC">'</font><font color="#FF00CC">"</font> <font color="#000000"><strong>+</strong></font> <font color="#006699"><strong>typeof</strong></font>(Need) <font color="#000000"><strong>+</strong></font> <font color="#FF00CC">"</font><font color="#FF00CC">'.</font><font color="#FF00CC">"</font>)<font color="#000000"><strong>;</strong></font>
                    <font color="#006699"><strong>return</strong></font> current<font color="#000000"><strong>.</strong></font>Provide<font color="#000000"><strong>&lt;</strong></font>Need<font color="#000000"><strong>&gt;</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>public</strong></font> <font color="#0099FF"><strong>class</strong></font> ClosedEnvironment <font color="#000000"><strong>:</strong></font> IEnvironment
        <font color="#000000"><strong>{</strong></font>
            <font color="#006699"><strong>private</strong></font> <font color="#006699"><strong>readonly</strong></font> <font color="#0099FF"><strong>object</strong></font><font color="#000000"><strong>[</strong></font><font color="#000000"><strong>]</strong></font> _bindings<font color="#000000"><strong>;</strong></font>
    
            <font color="#006699"><strong>public</strong></font> <font color="#9966FF">ClosedEnvironment</font>(<font color="#006699"><strong>params</strong></font> <font color="#0099FF"><strong>object</strong></font><font color="#000000"><strong>[</strong></font><font color="#000000"><strong>]</strong></font> bindings)
            <font color="#000000"><strong>{</strong></font>
                _bindings <font color="#000000"><strong>=</strong></font> bindings<font color="#000000"><strong>;</strong></font>
            <font color="#000000"><strong>}</strong></font>
            
            <font color="#006699"><strong>public</strong></font> T Provide<font color="#000000"><strong>&lt;</strong></font>T<font color="#000000"><strong>&gt;</strong></font>()
            <font color="#000000"><strong>{</strong></font>
                <font color="#006699"><strong>foreach</strong></font> (var binding <font color="#006699"><strong>in</strong></font> _bindings)
                    <font color="#006699"><strong>if</strong></font> (binding <font color="#006699"><strong>is</strong></font> T)
                        <font color="#006699"><strong>return</strong></font> (T) binding<font color="#000000"><strong>;</strong></font>
                <font color="#006699"><strong>return</strong></font> <font color="#006699"><strong>default</strong></font>(T)<font color="#000000"><strong>;</strong></font>
            <font color="#000000"><strong>}</strong></font>
        <font color="#000000"><strong>}</strong></font>
    <font color="#000000"><strong>}</strong></font>
</pre>
<p>In a future article I'll explore environment chaining and convention based service discovery. Thoughts?</p>
<p>* or to use a name more to the style of Martin Fowler: Dynamically Scoped Service Locator (<strong>not</strong> to be confused with <a href="http://martinfowler.com/articles/injection.html#ADynamicServiceLocator">Dynamic Service Locator</a>)<br /></p>
]]></description>
<dc:subject></dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2009-02-16T13:25:38-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001759_experience_boojay_with_monolipse_followup_ii_working_on_windows.html">
<title>Experience boojay with monolipse followup II - Working on Windows</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001759_experience_boojay_with_monolipse_followup_ii_working_on_windows.html</link>
<description><![CDATA[<blockquote>
  ...
</blockquote>
<blockquote>
  <strong>What do I need to do to get it to work on Windows?</strong>
</blockquote>
<blockquote>
  I've got mono + eclipse + rcp + monolipse installed. Eclipse's DMONO_HOME variable points the right place.
</blockquote>
<blockquote>
  I've got Boo 0.9 in a folder, but I'm not sure if it's the right place or if I need to do anything else. ...
</blockquote>
<blockquote>
  <strong>What's missing?</strong>
</blockquote>
<blockquote>
  --S&#248;ren, February 12, 2009 06:21 AM
</blockquote>
<p>Thanks for the question. The eclipse plugins expects the boo assemblies to be in the mono GAC and it also expects to find the boo compiler under $MONO_HOME/lib/boo, something that can be easily arranged by running nant in the boo source folder (yes, windows users need a source distro or a svn checkout for now):</p>
<pre style="color: white; background-color: black; padding: .5cm">
$ nant install -D:mono.prefix=c:/dotnet/mono-2.2
</pre>
<p>Enjoy!</p>
]]></description>
<dc:subject></dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2009-02-12T08:37:18-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001752_experience_boojay_with_monolipse_follow_up.html">
<title>Experience boojay with monolipse follow up</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001752_experience_boojay_with_monolipse_follow_up.html</link>
<description><![CDATA[<blockquote>
  <p>Very cool man.<br /></p>

  <p>BTW what's the name of the song in the background? :)<br /></p>

  <p>--Andr&#233;s G. Aragoneses, February 6, 2009 09:52 PM</p>
</blockquote>
<p>Thanks, Andr&#233;s. The song is <a href="http://en.wikipedia.org/wiki/Take_Five">Take Five</a>. I love it.</p>
<blockquote>
  <p>Awesome! You've just made me reinstall Eclipse! ;)</p>

  <p>The url in the post did not work for me, have had to use http instead of https.</p>

  <p>Another more disturbing issue, it insists for mono in /usr/local/bin probably /usr/bin would be a safer default, I tried to change it in preferences but it doesn't seem to change anything.. I think I've sent you a patch about it looong time ago but cannot find it anymore ;(</p>

  <p>Also maybe you should change the repository name to 'Monolipse' instead of 'file:/Users/rodrigob/projects/monolipse/update-site/ - artifacts' ;)</p>

  <p>--Cedric, February 7, 2009 05:33 AM</p>
</blockquote>
<p>Thanks, Cedric. I prefer /usr/local for my mono version and /usr for the system's mono version. Configuration via user interface is not yet implemented and I couldn't find the patch here, I hope that now that it's out there more people will contribute and this project might even realize its full potential. For now you need to start eclipse passing the MONO_HOME system property like this:</p>
<pre style="color: white; background-color: black; padding: 2px">
    eclipse -data /path/to/workspace -vmargs -DMONO_HOME=/usr
</pre>
<p>The same will work on windows.</p>
<p>Enjoy!</p>
]]></description>
<dc:subject></dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2009-02-07T08:04:39-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001751_experience_boojay_with_monolipse.html">
<title>Experience boojay with monolipse</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001751_experience_boojay_with_monolipse.html</link>
<description><![CDATA[<p><embed src="http://blip.tv/play/AeuET5PYJg" type="application/x-shockwave-flash" width="640" height="510" allowscriptaccess="always" allowfullscreen="true" /></p>
<p>Summing up:</p>
<ul>
  <li><a href="http://www.go-mono.com/mono-downloads/download.html">Get Mono 2.2+</a></li>

  <li><a href="http://dist.codehaus.org/boo/distributions/?C=M;O=D">Get Boo 0.9+</a></li>

  <li><a href="http://www.eclipse.org/downloads/">Get the Eclipse for RCP/Plug-in Developers 3.4+</a></li>

  <li>Install the plugins from the update site: https://monolipse.svn.sourceforge.net/svnroot/monolipse/trunk/update-site</li>
</ul>
<p>Enjoy!</p><br />
]]></description>
<dc:subject></dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2009-02-06T16:12:31-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001750_boo_09_introducing_type_member_macros.html">
<title>Boo 0.9 - Introducing Type Member Macros</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001750_boo_09_introducing_type_member_macros.html</link>
<description><![CDATA[<p>Let's consider the simple issue of defining a thread local variable. In .net this can be achieved rather efficiently through a static field annotated with the <em>System.ThreadStatic</em> attribute:<br /></p>
<pre>
<font color="#000000">    <font color="#006699"><strong>class</strong></font> WithPerThreadState<font color="#000000"><strong>:</strong></font>
        <font color="#000000"><strong>[</strong></font>System.ThreadStatic<font color="#000000"><strong>]</strong></font> <font color="#006699"><strong>static</strong></font> _state <font color="#006699"><strong>as</strong></font> PerThreadState
</font>
</pre>
<p>The problem with that is that there's redundancy (we have to say <em>static</em> twice) and there's noise (square brackets). If we're doing this more than once in a code base it would be good to avoid repeating ourselves. We should be able to hide the unnecessary implementation details of a thread static variable behind a macro and more succinctly say:</p>
<pre>
<font color="#000000">    <font color="#006699"><strong>class</strong></font> WithPerThreadState<font color="#000000"><strong>:</strong></font>
        ThreadStatic _state <font color="#006699"><strong>as</strong></font> PerThreadState
</font>
</pre>
<p>And now we are:</p>
<pre>
<font color="#000000">    <font color="#006699"><strong>macro</strong></font> ThreadStatic<font color="#000000"><strong>:</strong></font>
        <font color="#006699"><strong>case</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font> ThreadStatic $name <font color="#006699"><strong>as</strong></font> $type <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font><font color="#000000"><strong>:</strong></font>
            <font color="#006699"><strong>yield</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font>
                <font color="#000000"><strong>[</strong></font>System.ThreadStatic<font color="#000000"><strong>]</strong></font> <font color="#006699"><strong>static</strong></font> $name <font color="#006699"><strong>as</strong></font> $type
            <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font>
</font>
</pre>
<p>This example makes use of some of the most important improvements to macro expression in boo 0.9. Let's dissect it block by block:</p>
<pre>
<font color="#000000">    <font color="#006699"><strong>macro</strong></font> ThreadStatic<font color="#000000"><strong>:</strong></font>
        ...
</font>
</pre>
<p>Friendly macro definition using the <em>macro</em> macro. Yes, that's correct. For the boo compiler a macro is simply a type that implements a specific interface and optionally adheres to the "Macro" suffix naming convention. The <em>macro</em> macro generates the required boilerplate.</p>
<pre>
<font color="#000000">    ...
        <font color="#006699"><strong>case</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font> ThreadStatic $name <font color="#006699"><strong>as</strong></font> $type <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font><font color="#000000"><strong>:</strong></font>
            ...
</font>
</pre>
<p>The optional <em>case</em> clauses of a macro definition pattern match against the macro application and execute the body of the first matching <em>case. T<span style="font-style: normal;">he particular pattern we see here with the <strong>[| |]</strong> brackets is a code pattern. Pattern matching is a whole new feature in itself, for now it should suffice to say that <strong>$variableName</strong> inside a code pattern captures the code appearing at that position in the variable <strong>variableName</strong>. The <em>case</em> will only succeed if the macro was applied with a single <em>as</em> expression as its argument in which case the left operand of the <em>as</em> expression is made available through the <em>name</em> variable and its right operand through the <em>type</em> variable.</span></em></p>
<pre>
<font color="#000000">        ...
            <font color="#006699"><strong>yield</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font>
                <font color="#000000"><strong>[</strong></font>System.ThreadStatic<font color="#000000"><strong>]</strong></font> <font color="#006699"><strong>static</strong></font> $name <font color="#006699"><strong>as</strong></font> $type
            <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font>
</font>
</pre>
<p><em>yield</em> means macros are generators. They can produce many nodes of different types. In this particular case the macro is producing a single field declaration node expressed with a code literal<strong>*</strong>. The <strong>$</strong> inside a code literal is the splice operator: its operand is evaluated and the resulting node inserted into the code tree.</p>
<p>The usual modifiers can be used to control the visibility of members generated by the macro:</p>
<pre>
<font color="#000000">        <font color="#006699"><strong>public</strong></font> ThreadStatic State <font color="#006699"><strong>as</strong></font> PerThreadState
</font>
</pre>
<p>Modifiers and attributes are automatically propagated to every node yielded by the macro. **</p>
<p>There's much more to be said on these new capabilities but I'll leave that for another day. For now <a href="http://svn.codehaus.org/boo/boo/trunk/tests/testcases/macros/member-macro-producing-field-and-property.boo">these</a> <a href="http://svn.codehaus.org/boo/boo/trunk/tests/testcases/macros/member-macro-nodes-inherit-visibility-and-attributes.boo">test</a> <a href="http://svn.codehaus.org/boo/boo/trunk/tests/testcases/macros/member-macro-changing-all-sibling-method-bodies.boo">cases</a> <a href="http://svn.codehaus.org/boo/boo/trunk/tests/testcases/macros/member-macro-initialization-order.boo">might</a> <a href="http://svn.codehaus.org/boo/boo/trunk/tests/testcases/macros/member-macro-producing-field-and-constructor.boo">help</a>.</p>
<p>Happy meta hacking!</p>
<p><strong>* <span style="font-weight: normal;">I've referred to these <strong>[| |]</strong> entities as code patterns before. That's correct. Code patterns are code literals used in a pattern matching context such as the <em>case</em> in the ThreadStatic example.</span></strong></p>
<p>** macros can also control how modifiers and attributes are handled by modifying the code tree directly.</p>
]]></description>
<dc:subject></dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2009-01-28T08:02:16-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001749_boo_09_is_here.html">
<title>Boo 0.9 is here!</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001749_boo_09_is_here.html</link>
<description><![CDATA[<p>Also known as the best boo release ever its chief weapons are:<br /></p>
<ul>
  <li>Generator macros [<a href="http://jira.codehaus.org/browse/BOO-1077">BOO-1077</a>] - macros are no longer limited to returning a single statement or block and instead are able to <strong>yield</strong> an indefinite number of nodes:</li>
</ul>
<pre>
<font color="#000000">    <font color="#006699"><strong>macro</strong></font> printLines<font color="#000000"><strong>:</strong></font>
        <font color="#006699"><strong>for</strong></font> arg <font color="#006699"><strong>in</strong></font> printLines.Arguments<font color="#000000"><strong>:</strong></font>
            <font color="#006699"><strong>yield</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font> System.Console.WriteLine<font color="#000000"><strong>(</strong></font>$arg<font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font>
        
    printLines <font color="#FF00CC">"</font><font color="#FF00CC">silly</font><font color="#FF00CC">"</font>, <font color="#FF00CC">"</font><font color="#FF00CC">silly</font><font color="#FF00CC">"</font>, <font color="#FF00CC">"</font><font color="#FF00CC">silly</font><font color="#FF00CC">"</font>
</font>
</pre>
<ul>
  <li>Nestable macros [<a href="http://jira.codehaus.org/browse/BOO-1102">BOO-1120</a>] - macro definitions can be nested to allow for context sensitive keywords:</li>
</ul>
<pre>
<font color="#000000">    <font color="#006699"><strong>macro</strong></font> given<font color="#000000"><strong>:</strong></font>
        <font color="#006699"><strong>macro</strong></font> when<font color="#000000"><strong>:</strong></font>
            <font color="#006699"><strong>yield</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font> <font color="#0099FF"><strong>print</strong></font> <font color="#FF00CC">"</font><font color="#FF00CC">given</font><font color="#FF00CC">.</font><font color="#FF00CC">when</font><font color="#FF00CC">"</font> <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font>

        <font color="#006699"><strong>yield</strong></font>

    <font color="#006699"><strong>macro</strong></font> alert<font color="#000000"><strong>:</strong></font>
        <font color="#006699"><strong>macro</strong></font> when<font color="#000000"><strong>:</strong></font>
            <font color="#006699"><strong>yield</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font> <font color="#0099FF"><strong>print</strong></font> <font color="#FF00CC">"</font><font color="#FF00CC">alert</font><font color="#FF00CC">.</font><font color="#FF00CC">when</font><font color="#FF00CC">"</font> <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font>
        <font color="#006699"><strong>yield</strong></font>
   
    given<font color="#000000"><strong>:</strong></font>
        when <font color="#CC0000">//</font><font color="#CC0000"> </font><font color="#CC0000">given.when</font>
    
    alert<font color="#000000"><strong>:</strong></font>
        when <font color="#CC0000">//</font><font color="#CC0000"> </font><font color="#CC0000">alert.when</font>
</font>
</pre>
<ul>
  <li>Type member macros [<a href="http://jira.codehaus.org/browse/BOO-1102">BOO-415</a>] - macros can be used in class definition bodies:</li>
</ul>
<pre>
<font color="#000000">    <font color="#006699"><strong>macro</strong></font> ThreadStatic<font color="#000000"><strong>:</strong></font>
        <font color="#006699"><strong>case</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font> ThreadStatic $name <font color="#006699"><strong>as</strong></font> $type <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font><font color="#000000"><strong>:</strong></font>
            <font color="#006699"><strong>yield</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font>
                <font color="#000000"><strong>[</strong></font>System.ThreadStatic<font color="#000000"><strong>]</strong></font> <font color="#006699"><strong>static</strong></font> $name <font color="#006699"><strong>as</strong></font> $type
            <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font>
    
    <font color="#006699"><strong>class</strong></font> Environments<font color="#000000"><strong>:</strong></font>
        <font color="#006699"><strong>private</strong></font> ThreadStatic _current <font color="#006699"><strong>as</strong></font> Environment
</font>
</pre>
<ul>
  <li>Pattern matching [<a href="http://jira.codehaus.org/browse/BOO-1106">BOO-1106</a>] - simple but powerful object pattern matching with the <strong>match</strong>/<strong>case</strong>/<strong>otherwise</strong> macros:</li>
</ul>
<pre>
<font color="#000000">   <font color="#006699"><strong>import</strong></font> Boo.Lang.PatternMatching
    
    <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>
        <font color="#006699"><strong>match</strong></font> e<font color="#000000"><strong>:</strong></font>
            <font color="#006699"><strong>case</strong></font> 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

            <font color="#006699"><strong>case</strong></font> InfixExpression<font color="#000000"><strong>(</strong></font>Operator<font color="#000000"><strong>:</strong></font> <font color="#FF00CC">"</font><font color="#FF00CC">+</font><font color="#FF00CC">"</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>case</strong></font> InfixExpression<font color="#000000"><strong>(</strong></font>Operator<font color="#000000"><strong>:</strong></font> <font color="#FF00CC">"</font><font color="#FF00CC">-</font><font color="#FF00CC">"</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> <strong>-</strong> Eval<font color="#000000"><strong>(</strong></font>Right<font color="#000000"><strong>)</strong></font>
</font>
</pre>
<ul>
  <li>Support for generic extension methods [<a href="http://jira.codehaus.org/browse/BOO-937">BOO-937</a>] - LINQ style extension methods:</li>
</ul>
<pre>
<font color="#000000">    <font color="#006699"><strong>import</strong></font> System.Linq.Enumerable <font color="#006699"><strong>from</strong></font> System.Core
    
    <font color="#000000"><strong>[</strong></font>Extension<font color="#000000"><strong>]</strong></font>
    <font color="#006699"><strong>def</strong></font> MakeString<font color="#000000"><strong>[</strong></font><font color="#006699"><strong>of</strong></font> T<font color="#000000"><strong>]</strong></font><font color="#000000"><strong>(</strong></font>source <font color="#006699"><strong>as</strong></font> T<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="#0099FF"><strong>join</strong></font><font color="#000000"><strong>(</strong></font>source, <font color="#FF00CC">"</font><font color="#FF00CC">,</font><font color="#FF00CC"> </font><font color="#FF00CC">"</font><font color="#000000"><strong>)</strong></font>
    
    evenDoubles <font color="#000000"><strong>=</strong></font> range<font color="#000000"><strong>(</strong></font><font color="#FF0000">10</font><font color="#000000"><strong>)</strong></font>.Where<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>{</strong></font> i <font color="#006699"><strong>as</strong></font> <font color="#009966"><strong>int</strong></font> <font color="#000000"><strong>|</strong></font> i <font color="#000000"><strong>%</strong></font> <font color="#FF0000">2</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="#000000"><strong>)</strong></font>.Select<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>{</strong></font> i <font color="#006699"><strong>as</strong></font> <font color="#009966"><strong>int</strong></font> <font color="#000000"><strong>|</strong></font> i <font color="#000000"><strong>*</strong></font> <font color="#FF0000">2</font> <font color="#000000"><strong>}</strong></font><font color="#000000"><strong>)</strong></font>
    <font color="#0099FF"><strong>print</strong></font> evenDoubles.MakeString<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
</font>
</pre>
<ul>
  <li>Generic parameter constraints [<a href="http://jira.codehaus.org/browse/BOO-937">BOO-935</a>] and Generic parameter type inference [<a href="http://jira.codehaus.org/browse/BOO-1102">BOO-1102</a>]:</li>
</ul>
<pre>
<font color="#000000">    <font color="#006699"><strong>def</strong></font> Using<font color="#000000"><strong>[</strong></font><font color="#006699"><strong>of</strong></font> T<font color="#000000"><strong>(</strong></font>System.IDisposable<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>]</strong></font><font color="#000000"><strong>(</strong></font>value <font color="#006699"><strong>as</strong></font> T, block <font color="#006699"><strong>as</strong></font> System.Action<font color="#000000"><strong>[</strong></font><font color="#006699"><strong>of</strong></font> T<font color="#000000"><strong>]</strong></font><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>
            block<font color="#000000"><strong>(</strong></font>value<font color="#000000"><strong>)</strong></font>
        <font color="#006699"><strong>ensure</strong></font><font color="#000000"><strong>:</strong></font>
            value.Dispose<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
    
    Using<font color="#000000"><strong>(</strong></font>System.IO.File.OpenText<font color="#000000"><strong>(</strong></font><font color="#FF00CC">"</font><font color="#FF00CC">TFM</font><font color="#FF00CC">.</font><font color="#FF00CC">TXT</font><font color="#FF00CC">"</font><font color="#000000"><strong>)</strong></font>, <font color="#000000"><strong>{</strong></font> reader <font color="#000000"><strong>|</strong></font> <font color="#0099FF"><strong>print</strong></font> reader.ReadLine<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>
<ul>
  <li>Strict mode [<a href="http://jira.codehaus.org/browse/BOO-1115">BOO-1115</a>] - strict mode changes a few compiler rules: default visibility for members is private, method parameter types and return types must be explicitly declared among other things</li>
</ul>
<ul>
  <li>Asymmetric property accessor visibility [<a href="http://jira.codehaus.org/browse/BOO-1094">BOO-1094</a>]</li>
</ul>
<pre>
<font color="#000000">    <font color="#006699"><strong>class</strong></font> Song<font color="#000000"><strong>:</strong></font>
        Name <font color="#006699"><strong>as</strong></font> <font color="#009966"><strong>string</strong></font><font color="#000000"><strong>:</strong></font>
            <font color="#006699"><strong>public</strong></font> <font color="#006699"><strong>get</strong></font><font color="#000000"><strong>:</strong></font>
                <font color="#006699"><strong>return</strong></font> _name
            <font color="#006699"><strong>internal</strong></font> <font color="#006699"><strong>set</strong></font><font color="#000000"><strong>:</strong></font>
                _name <font color="#000000"><strong>=</strong></font> value
        ...
</font>
</pre>
<ul>
  <li>String interpolation formatting (eg. "${val:x4}") [<a href="http://jira.codehaus.org/browse/BOO-1006">BOO-1006</a>] - .<a href="http://msdn.microsoft.com/en-us/library/fbxft59x.aspx">net formatting specifiers</a> can now be used together with string interpolation:</li>
</ul>
<pre>
<font color="#000000">    <font color="#006699"><strong>def</strong></font> ToHex<font color="#000000"><strong>(</strong></font>n <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>
        <font color="#006699"><strong>return</strong></font> <font color="#FF00CC">"</font><font color="#FF00CC">0x</font><font color="#9900CC">${</font><font color="#9900CC">n:x4</font><font color="#9900CC">}</font><font color="#FF00CC">"</font>
    
    <font color="#0099FF"><strong>print</strong></font> ToHex<font color="#000000"><strong>(</strong></font><font color="#FF0000">42</font><font color="#000000"><strong>)</strong></font>
</font>
</pre>
<ul>
  <li>Support for SilverLight profile [<a href="http://jira.codehaus.org/browse/BOO-1117">BOO-1117</a>] - and <a href="http://tinyurl.com/dx8d3j">Vladimir Lazunin</a> kicked it off with <a href="http://lazunin.com/tetris_boo.html">Tetris</a>.</li>
</ul>
<p>This release is brought to you by Avishay Lavie, Cedric Vivier, Daniel Grunwald, Marcus Griep and yours truly.</p>
<p>Full change log is <a href="http://tinyurl.com/by32ep">here</a>.</p>
<p>Download it from <a href="http://dist.codehaus.org/boo/distributions/?C=M;O=D">here</a> and have fun!<br /></p>
]]></description>
<dc:subject></dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2009-01-27T07:50:48-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001722_boo_ometa_and_extensible_parsing_i.html">
<title>boo, ometa and extensible parsing I</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001722_boo_ometa_and_extensible_parsing_i.html</link>
<description><![CDATA[<p>
Meanwhile in a <a href="http://code.google.com/p/boo-extensions/">repository</a> not far away:
<br />
<pre><font color="#000000">    <font color="#006699"><strong>namespace</strong></font> metaboo

    <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.OMeta
    <font color="#006699"><strong>import</strong></font> Boo.OMeta.Parser

    syntax Units<font color="#000000"><strong>:</strong></font>
        atom <font color="#000000"><strong>=</strong></font> mass <font color="#000000"><strong>|</strong></font> <font color="#009966"><strong>super</strong></font>
        mass <font color="#000000"><strong>=</strong></font> <font color="#000000"><strong>(</strong></font>integer <font color="#000000"><strong>&gt;</strong></font><font color="#000000"><strong>&gt;</strong></font> value <font color="#006699"><strong>as</strong></font> Expression, <font color="#ff00cc">&quot;</font><font color="#ff00cc">kg</font><font color="#ff00cc">&quot;</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> Mass<font color="#000000"><strong>(</strong></font>$value, <font color="#ff00cc">&quot;</font><font color="#ff00cc">kg</font><font color="#ff00cc">&quot;</font><font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>|</strong></font><font color="#000000"><strong>]</strong></font>

    syntax Ranges<font color="#000000"><strong>:</strong></font>
        atom <font color="#000000"><strong>=</strong></font> integer_range <font color="#000000"><strong>|</strong></font> <font color="#009966"><strong>super</strong></font>
        integer_range <font color="#000000"><strong>=</strong></font> <font color="#000000"><strong>(</strong></font>integer <font color="#000000"><strong>&gt;</strong></font><font color="#000000"><strong>&gt;</strong></font> begin <font color="#006699"><strong>as</strong></font> Expression, DOT, DOT, integer <font color="#000000"><strong>&gt;</strong></font><font color="#000000"><strong>&gt;</strong></font> <font color="#006699"><strong>end</strong></font> <font color="#006699"><strong>as</strong></font> Expression<font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>^</strong></font> <font color="#000000"><strong>[</strong></font><font color="#000000"><strong>|</strong></font> range<font color="#000000"><strong>(</strong></font>$begin, $<font color="#006699"><strong>end</strong></font><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> parse<font color="#000000"><strong>(</strong></font>code <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>
        compiler <font color="#000000"><strong>=</strong></font> BooCompiler<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
        compiler.Parameters.References.Add<font color="#000000"><strong>(</strong></font>System.Reflection.Assembly.GetExecutingAssembly<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font>
        compiler.Parameters.Input.Add<font color="#000000"><strong>(</strong></font>IO.StringInput<font color="#000000"><strong>(</strong></font><font color="#ff00cc">&quot;</font><font color="#ff00cc">code</font><font color="#ff00cc">&quot;</font>, code<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font>
        compiler.Parameters.Pipeline <font color="#000000"><strong>=</strong></font> CompilerPipeline<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
        compiler.Parameters.Pipeline.Add<font color="#000000"><strong>(</strong></font>BooParserStep<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> compiler.Run<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>

    code <font color="#000000"><strong>=</strong></font> <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">import</font><font color="#ff00cc"> </font><font color="#ff00cc">metaboo</font><font color="#ff00cc">.</font><font color="#ff00cc">Units</font>
<font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc">import</font><font color="#ff00cc"> </font><font color="#ff00cc">metaboo</font><font color="#ff00cc">.</font><font color="#ff00cc">Ranges</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">=</font><font color="#ff00cc"> </font><font color="#ff00cc">3kg</font>
<font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc">print</font><font color="#ff00cc"> </font><font color="#ff00cc">a</font>
<font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc">for</font><font color="#ff00cc"> </font><font color="#ff00cc">i</font><font color="#ff00cc"> </font><font color="#ff00cc">in</font><font color="#ff00cc"> </font><font color="#ff00cc">1</font><font color="#ff00cc">.</font><font color="#ff00cc">.</font><font color="#ff00cc">3</font><font color="#ff00cc">:</font>
<font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc">print</font><font color="#ff00cc"> </font><font color="#ff00cc">i</font>
<font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc"> </font><font color="#ff00cc">&quot;&quot;&quot;</font>

    result <font color="#000000"><strong>=</strong></font> parse<font color="#000000"><strong>(</strong></font>code<font color="#000000"><strong>)</strong></font>
    <font color="#0099ff"><strong>assert</strong></font> <font color="#ff0000">0</font> <font color="#000000"><strong>=</strong></font><font color="#000000"><strong>=</strong></font> <font color="#0099ff"><strong>len</strong></font><font color="#000000"><strong>(</strong></font>result.Errors<font color="#000000"><strong>)</strong></font>, result.Errors.ToString<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
    <font color="#0099ff"><strong>assert</strong></font> <font color="#ff0000">1</font> <font color="#000000"><strong>=</strong></font><font color="#000000"><strong>=</strong></font> <font color="#0099ff"><strong>len</strong></font><font color="#000000"><strong>(</strong></font>result.CompileUnit.Modules<font color="#000000"><strong>)</strong></font>
    <font color="#0099ff"><strong>print</strong></font> result.CompileUnit.Modules<font color="#000000"><strong>[</strong></font><font color="#ff0000">0</font><font color="#000000"><strong>]</strong></font>.ToCodeString<font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
</font></pre>
</p>
<p>And the output is, of course:
<br />
<pre style="padding: 1cm; background-color: black; color: white">
	import metaboo.Units
	import metaboo.Ranges
	
	a = Mass(3, 'kg')
	print a
	for i in range(1, 3):
		print i
</pre>
</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2008-08-05T09:52:06-03:00</dc:date>
</item>
<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>
Unfortunately though this optimization is only available when building for the .NET 2.0 profile.
</p><p>
Soon in a source code repository near you.
</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-05-21T07:58:03-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001577_on_my_way_to_the_dlr_compiler_lab.html">
<title>On my way to the DLR Compiler Lab</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001577_on_my_way_to_the_dlr_compiler_lab.html</link>
<description><![CDATA[<p>
I've just arrived in Seattle for the Microsoft DLR Compiler Lab. <a href="http://evain.net/blog/">JB</a> will be here soon and I heard <a href="http://tirania.org/blog/archive/2007/May-17.html">Miguel is joining us as well</a>. Fun!
</p><p>
Looking forward to getting my first Boo Silverlight application running.
</p><p>
One of the questions I'm here for is <strong>should we migrate Boo's duck typing support to be based on the DLR?</strong> On the pros side we get better integration with all the DLR languages and perhaps better performance when executing dynamic code. On the cons side it's an additional dependency (and not a very mature one for that matter).
</p><p>
Thoughts?
</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-05-19T18:29:06-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001576_overload_resolution_rehaul.html">
<title>Overload Resolution rehaul</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001576_overload_resolution_rehaul.html</link>
<description><![CDATA[<p>
I started reviewing the overload resolution code in the boo compiler this week. Very old and, let's say, very interesting code. It was based on a fuzzy scoring system I have no idea how I came up with. Well, these things happen.
</p><p>
The new code is based on the concepts discussed <a href="http://archive.boo.codehaus.org/dev/960015.71678.qm%40web36906.mail.mud.yahoo.com">here</a>. Thanks Avish and Daniel for that!
</p><p>
A few test cases (mostly varargs related) had to be reviewed to comply with the improved behavior so expect a few compilation errors when updating to the new code and please let us know of any strange behavior.
</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-05-19T18:19:08-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001573_db4o_activation_and_transparent_activation_i.html">
<title>Db4o, Activation and Transparent Activation I</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001573_db4o_activation_and_transparent_activation_i.html</link>
<description><![CDATA[<style type="text/css"><!--
.syntax0 {
color: #000000;
}
.syntax1 {
color: #cc0000;
}
.syntax2 {
color: #ff8400;
}
.syntax3 {
color: #6600cc;
}
.syntax4 {
color: #cc6600;
}
.syntax5 {
color: #ff0000;
}
.syntax6 {
color: #9966ff;
}
.syntax7 {
background: #ffffcc;
color: #ff0066;
}
.syntax8 {
color: #006699;
font-weight: bold;
}
.syntax9 {
color: #009966;
font-weight: bold;
}
.syntax10 {
color: #0099ff;
font-weight: bold;
}
.syntax11 {
color: #66ccff;
font-weight: bold;
}
.syntax12 {
color: #02b902;
}
.syntax13 {
color: #ff00cc;
}
.syntax14 {
color: #cc00cc;
}
.syntax15 {
color: #9900cc;
}
.syntax16 {
color: #6600cc;
}
.syntax17 {
color: #0000ff;
}
.syntax18 {
color: #000000;
font-weight: bold;
}
.gutter {
background: #dbdbdb;
color: #000000;
}
.gutterH {
background: #dbdbdb;
color: #990066;
}
--></style>
<p>
Life looks good so let's consider a very simple data structure. A linked list:
</p><pre><span class="syntax0"><span class="gutter">   1:</span><span class="syntax8">import</span> System.Collections
<span class="gutter">   2:</span>
<span class="gutter">   3:</span><span class="syntax8">class</span> LinkedList<span class="syntax18">(</span>IEnumerable<span class="syntax18">)</span><span class="syntax18">:</span>
<span class="gutter">   4:</span>    
<span class="gutterH">   5:</span>    _head <span class="syntax8">as</span> Node
<span class="gutter">   6:</span>    
<span class="gutter">   7:</span>    <span class="syntax8">def</span> <span class="syntax8">constructor</span><span class="syntax18">(</span><span class="syntax18">*</span>values<span class="syntax18">)</span><span class="syntax18">:</span>
<span class="gutter">   8:</span>        <span class="syntax8">for</span> value <span class="syntax8">in</span> values<span class="syntax18">:</span>
<span class="gutter">   9:</span>            Add<span class="syntax18">(</span>value<span class="syntax18">)</span>
<span class="gutterH">  10:</span>    
<span class="gutter">  11:</span>    <span class="syntax8">def</span> Add<span class="syntax18">(</span>value<span class="syntax18">)</span><span class="syntax18">:</span>
<span class="gutter">  12:</span>        _head <span class="syntax18">=</span> Node<span class="syntax18">(</span>value, _head<span class="syntax18">)</span>
<span class="gutter">  13:</span>        
<span class="gutter">  14:</span>    <span class="syntax8">def</span> GetEnumerator<span class="syntax18">(</span><span class="syntax18">)</span><span class="syntax18">:</span>
<span class="gutterH">  15:</span>        node <span class="syntax18">=</span> _head
<span class="gutter">  16:</span>        <span class="syntax8">while</span> node <span class="syntax8">is</span> <span class="syntax8">not</span> <span class="syntax14">null</span><span class="syntax18">:</span>
<span class="gutter">  17:</span>            <span class="syntax8">yield</span> node.Value
<span class="gutter">  18:</span>            node <span class="syntax18">=</span> node.Next
<span class="gutter">  19:</span>            
<span class="gutterH">  20:</span>    <span class="syntax8">class</span> Node<span class="syntax18">:</span>
<span class="gutter">  21:</span>    
<span class="gutter">  22:</span>        _value <span class="syntax8">as</span> <span class="syntax9">object</span>    
<span class="gutter">  23:</span>        _next <span class="syntax8">as</span> Node
<span class="gutter">  24:</span>        
<span class="gutterH">  25:</span>        <span class="syntax8">def</span> <span class="syntax8">constructor</span><span class="syntax18">(</span>value, next <span class="syntax8">as</span> Node<span class="syntax18">)</span><span class="syntax18">:</span>
<span class="gutter">  26:</span>            _value <span class="syntax18">=</span> value
<span class="gutter">  27:</span>            _next <span class="syntax18">=</span> next
<span class="gutter">  28:</span>
<span class="gutter">  29:</span>        Value<span class="syntax18">:</span>
<span class="gutterH">  30:</span>            <span class="syntax8">get</span><span class="syntax18">:</span>
<span class="gutter">  31:</span>                <span class="syntax8">return</span> _value
<span class="gutter">  32:</span>            
<span class="gutter">  33:</span>        Next<span class="syntax18">:</span>
<span class="gutter">  34:</span>            <span class="syntax8">get</span><span class="syntax18">:</span>
<span class="gutterH">  35:</span>                <span class="syntax8">return</span> _next
</span></pre><p>
Our LinkedList class can be used like this:
</p><pre><span class="syntax0"><span class="gutter">   1:</span>list <span class="syntax18">=</span> LinkedList<span class="syntax18">(</span><span class="syntax13">&quot;</span><span class="syntax13">Eric</span><span class="syntax13"> </span><span class="syntax13">Idle</span><span class="syntax13">&quot;</span>,
<span class="gutter">   2:</span>                <span class="syntax13">&quot;</span><span class="syntax13">John</span><span class="syntax13"> </span><span class="syntax13">Cleese</span><span class="syntax13">&quot;</span>,
<span class="gutter">   3:</span>                <span class="syntax13">&quot;</span><span class="syntax13">Graham</span><span class="syntax13"> </span><span class="syntax13">Chapman</span><span class="syntax13">&quot;</span>,
<span class="gutter">   4:</span>                <span class="syntax13">&quot;</span><span class="syntax13">Terry</span><span class="syntax13"> </span><span class="syntax13">Gilliam</span><span class="syntax13">&quot;</span>,
<span class="gutterH">   5:</span>                <span class="syntax13">&quot;</span><span class="syntax13">Terry</span><span class="syntax13"> </span><span class="syntax13">Jones</span><span class="syntax13">&quot;</span>,
<span class="gutter">   6:</span>                <span class="syntax13">&quot;</span><span class="syntax13">Michael</span><span class="syntax13"> </span><span class="syntax13">Palim</span><span class="syntax13">&quot;</span><span class="syntax18">)</span>
<span class="gutter">   7:</span><span class="syntax8">for</span> item <span class="syntax8">in</span> list<span class="syntax18">:</span>
<span class="gutter">   8:</span>    <span class="syntax10">print</span> item
</span></pre>
<p>Which unsurprisingly gives the following output:</p>
<pre style="background-color: black; color: white">
Michael Palim
Terry Jones
Terry Gilliam
Graham Chapman
John Cleese
Eric Idle
</pre>
<p>
Now let's move on and store our beautifully crafted LinkedList instance with Db4o:
</p>
<pre><span class="syntax0"><span class="gutter">   1:</span>
<span class="gutter">   2:</span><span class="syntax10">using</span> container <span class="syntax18">=</span> Db4oFactory.OpenFile<span class="syntax18">(</span>fname<span class="syntax18">)</span><span class="syntax18">:</span>
<span class="gutter">   3:</span>    container.Set<span class="syntax18">(</span>list<span class="syntax18">)</span>
<span class="gutter">   4:</span>
</span></pre>
<p>
Some time later:
</p>
<pre><span class="syntax0"><span class="gutter">   1:</span>
<span class="gutter">   2:</span><span class="syntax10">using</span> container <span class="syntax18">=</span> Db4oFactory.OpenFile<span class="syntax18">(</span>fname<span class="syntax18">)</span><span class="syntax18">:</span>
<span class="gutter">   3:</span>    list <span class="syntax18">=</span> container.Query<span class="syntax18">(</span>LinkedList<span class="syntax18">)</span>.Next<span class="syntax18">(</span><span class="syntax18">)</span>
<span class="gutter">   4:</span>    <span class="syntax8">for</span> item <span class="syntax8">in</span> list<span class="syntax18">:</span>
<span class="gutterH">   5:</span>        <span class="syntax10">print</span> item <span class="syntax8">or</span> <span class="syntax13">&quot;</span><span class="syntax13">&lt;</span><span class="syntax13">null</span><span class="syntax13">&gt;</span><span class="syntax13">&quot;</span>
<span class="gutter">   6:</span>
</span></pre>
<p>Which gives:</p>
<pre style="background-color: black; color: white">
Michael Palim
Terry Jones
Terry Gilliam
Graham Chapman
&lt;null&gt;
</pre>
<p>Uh, oh... What's going on?</p>
<p><b>Activation</b> is going on, that's what it is.</p>
<p>
<strong>Activation</strong> is the process of populating the attributes of an object with previously stored data.
</p><p>
Db4o activates an object the first time it is retrieved from the database and whenever instructed to do so by the application through IObjectContainer.Activate.
</p><p>
During activation Db4o will also follow the references in the object graph activating any referenced objects until a configured <strong>activation depth </strong>is reached.
</p>
<p>We can make sense of the output if we consider  that Db4o has its <b>default activation depth</b> set to 5.</p>
<p>When activating the list Db4o will follow the LinkedList._head reference and activate the first node, then follow the Node._next reference and so on until it reaches the 5th node which it's not activated further and has its members set to <b>null</b>.</p>
<p>Now that we can understand the output has life gotten any easier?</p>
<p>Well, we can ask Db4o to activate the list to the depth of 7:</p>
<pre><span class="syntax0"><span class="gutter">   1:</span>
<span class="gutter">   2:</span><span class="syntax10">using</span> container <span class="syntax18">=</span> Db4oFactory.OpenFile<span class="syntax18">(</span>configuration, fname<span class="syntax18">)</span><span class="syntax18">:</span>
<span class="gutter">   3:</span>    list <span class="syntax18">=</span> container.Query<span class="syntax18">(</span>LinkedList<span class="syntax18">)</span>.Next<span class="syntax18">(</span><span class="syntax18">)</span>
<span class="gutter">   4:</span><span style="background-color: yellow">    container.Activate<span class="syntax18">(</span>list, <span class="syntax5">7</span><span class="syntax18">)</span></span>
<span class="gutterH">   5:</span>    <span class="syntax8">for</span> item <span class="syntax8">in</span> list<span class="syntax18">:</span>
<span class="gutter">   6:</span>        <span class="syntax10">print</span> item <span class="syntax8">or</span> <span class="syntax13">&quot;</span><span class="syntax13">&lt;</span><span class="syntax13">null</span><span class="syntax13">&gt;</span><span class="syntax13">&quot;</span>
</span></pre>
<p>Which gives us the correct output but smells funny.</p>
<p>Application logic shouldn't have to worry about activation depth and all that. And how are we supposed to track the required activation depth for these dynamic object graphs?</p>
<p>Enter <b>Transparent Activation</b>.</p>
<p>Transparent Activation works by giving the objects in the system the responsibility of activating themselves before accessing any attribute. The activation must happen through a provided <b>activator object</b> which keeps track of everything needed for activation to work. The <b>activator object</b> is made available to any object that implements the <b>IActivatable</b> interface:</p>
<pre><span class="syntax0"><span class="gutter">   1:</span>
<span class="gutter">   2:</span><span class="syntax8">class</span> LinkedList<span class="syntax18">(</span>IEnumerable <span style="background-color: yellow">, IActivatable</span><span class="syntax18">)</span><span class="syntax18">:</span>
<span class="gutter">   3:</span>    
<span class="gutter">   4:</span>    _head <span class="syntax8">as</span> Node
<span class="gutterH">   5:</span>    
<span style="background-color: yellow"><span class="gutter">   6:</span>    <span class="syntax8">transient</span> _activator <span class="syntax8">as</span> IActivator</span>
<span class="gutter">   7:</span>    
<span class="gutter">   8:</span>    <span class="syntax8">def</span> <span class="syntax8">constructor</span><span class="syntax18">(</span><span class="syntax18">*</span>values<span class="syntax18">)</span><span class="syntax18">:</span>
<span class="gutter">   9:</span>        <span class="syntax8">for</span> value <span class="syntax8">in</span> values<span class="syntax18">:</span>
<span class="gutterH">  10:</span>            Add<span class="syntax18">(</span>value<span class="syntax18">)</span>
<span class="gutter">  11:</span>    
<span class="gutter">  12:</span>    <span class="syntax8">def</span> Add<span class="syntax18">(</span>value<span class="syntax18">)</span><span class="syntax18">:</span>
<span style="background-color: yellow"><span class="gutter">  13:</span>        Activate<span class="syntax18">(</span><span class="syntax18">)</span></span>
<span class="gutter">  14:</span>        _head <span class="syntax18">=</span> Node<span class="syntax18">(</span>value, _head<span class="syntax18">)</span>
<span class="gutterH">  15:</span>        
<span class="gutter">  16:</span>    <span class="syntax8">def</span> GetEnumerator<span class="syntax18">(</span><span class="syntax18">)</span><span class="syntax18">:</span>
<span style="background-color: yellow"><span class="gutter">  17:</span>        Activate<span class="syntax18">(</span><span class="syntax18">)</span></span>
<span class="gutter">  18:</span>        node <span class="syntax18">=</span> _head
<span class="gutter">  19:</span>        <span class="syntax8">while</span> node <span class="syntax8">is</span> <span class="syntax8">not</span> <span class="syntax14">null</span><span class="syntax18">:</span>
<span class="gutterH">  20:</span>            <span class="syntax8">yield</span> node.Value
<span class="gutter">  21:</span>            node <span class="syntax18">=</span> node.Next
<span class="gutter">  22:</span>  
<span style="background-color: yellow">
<span class="gutter">  23:</span>    <span class="syntax8">def</span> IActivatable.Bind<span class="syntax18">(</span>activator <span class="syntax8">as</span> IActivator<span class="syntax18">)</span><span class="syntax18">:</span>
<span class="gutter">  24:</span>        _activator <span class="syntax18">=</span> activator
<span class="gutterH">  25:</span>        
<span class="gutter">  26:</span>    <span class="syntax8">def</span> Activate<span class="syntax18">(</span><span class="syntax18">)</span><span class="syntax18">:</span>
<span class="gutter">  27:</span>        <span class="syntax8">if</span> _activator <span class="syntax8">is</span> <span class="syntax14">null</span><span class="syntax18">:</span> <span class="syntax8">return</span>
<span class="gutter">  28:</span>        _activator.Activate<span class="syntax18">(</span><span class="syntax18">)</span>
<span class="gutter">  29:</span>        
</span>
<span class="gutterH">  30:</span>    <span class="syntax8">class</span> Node<span class="syntax18">(</span><span style="background-color: yellow">IActivatable</span><span class="syntax18">)</span><span class="syntax18">:</span>
<span class="gutter">  31:</span>
<span class="gutter">  32:</span>        _value <span class="syntax8">as</span> <span class="syntax9">object</span>
<span class="gutter">  33:</span>
<span class="gutter">  34:</span>        _next <span class="syntax8">as</span> Node
<span class="gutterH">  35:</span>        
<span style="background-color: yellow"><span class="gutter">  36:</span>        <span class="syntax8">transient</span> _activator <span class="syntax8">as</span> IActivator</span>
<span class="gutter">  37:</span>        
<span class="gutter">  38:</span>        <span class="syntax8">def</span> <span class="syntax8">constructor</span><span class="syntax18">(</span>value, next <span class="syntax8">as</span> Node<span class="syntax18">)</span><span class="syntax18">:</span>
<span class="gutter">  39:</span>            _value <span class="syntax18">=</span> value
<span class="gutterH">  40:</span>            _next <span class="syntax18">=</span> next
<span class="gutter">  41:</span>
<span class="gutter">  42:</span>        Value<span class="syntax18">:</span>
<span class="gutter">  43:</span>            <span class="syntax8">get</span><span class="syntax18">:</span>
<span style="background-color: yellow"><span class="gutter">  44:</span>                Activate<span class="syntax18">(</span><span class="syntax18">)</span></span>
<span class="gutterH">  45:</span>                <span class="syntax8">return</span> _value
<span class="gutter">  46:</span>            
<span class="gutter">  47:</span>        Next<span class="syntax18">:</span>
<span class="gutter">  48:</span>            <span class="syntax8">get</span><span class="syntax18">:</span>
<span style="background-color: yellow"><span class="gutter">  49:</span>                Activate<span class="syntax18">(</span><span class="syntax18">)</span></span>
<span class="gutterH">  50:</span>                <span class="syntax8">return</span> _next
<span class="gutter">  51:</span>        
<span style="background-color: yellow">
<span class="gutter">  52:</span>        <span class="syntax8">def</span> IActivatable.Bind<span class="syntax18">(</span>activator <span class="syntax8">as</span> IActivator<span class="syntax18">)</span><span class="syntax18">:</span>
<span class="gutter">  53:</span>            _activator <span class="syntax18">=</span> activator
<span class="gutter">  54:</span>            
<span class="gutterH">  55:</span>        <span class="syntax8">private</span> <span class="syntax8">def</span> Activate<span class="syntax18">(</span><span class="syntax18">)</span><span class="syntax18">:</span>
<span class="gutter">  56:</span>            <span class="syntax8">if</span> _activator <span class="syntax8">is</span> <span class="syntax14">null</span><span class="syntax18">:</span> <span class="syntax8">return</span>
<span class="gutter">  57:</span>            _activator.Activate<span class="syntax18">(</span><span class="syntax18">)</span>
</span>
<span class="gutter">  58:</span>            
</span></pre>
<p>The application just needs to enable Transparent Activation once and then everything should work as expected (no more explicit Activate calls from the application):</p>
<pre><span class="syntax0"><span class="gutter">   1:</span>                    
<span style="background-color: yellow"><span class="gutter">   2:</span>configuration <span class="syntax18">=</span> Db4oFactory.NewConfiguration<span class="syntax18">(</span><span class="syntax18">)</span>
<span class="gutter">   3:</span>configuration.Add<span class="syntax18">(</span>TransparentActivationSupport<span class="syntax18">(</span><span class="syntax18">)</span><span class="syntax18">)</span></span>
<span class="gutter">   4:</span>
<span class="gutterH">   5:</span><span class="syntax10">using</span> container <span class="syntax18">=</span> Db4oFactory.OpenFile<span class="syntax18">(</span>configuration, fname<span class="syntax18">)</span><span class="syntax18">:</span>
<span class="gutter">   6:</span>    list <span class="syntax18">=</span> container.Query<span class="syntax18">(</span>LinkedList<span class="syntax18">)</span>.Next<span class="syntax18">(</span><span class="syntax18">)</span>
<span class="gutter">   7:</span>    <span class="syntax8">for</span> item <span class="syntax8">in</span> list<span class="syntax18">:</span>
<span class="gutter">   8:</span>        <span class="syntax10">print</span> item <span class="syntax8">or</span> <span class="syntax13">&quot;</span><span class="syntax13">&lt;</span><span class="syntax13">null</span><span class="syntax13">&gt;</span><span class="syntax13">&quot;</span>
</span></pre>
<p></p>
<p>Life looks better but what about all that boilerplate code that must go into the object model?</p>
<p>The next Db4o release will ship with an instrumentation tool capable of injecting the right IL instructions into an object model to make it Transparent Activation ready.</p>
<p>If you are curious to see this code in action grab it <a href="http://codehaus.org/~bamboo/TABlog.zip">here</a>.</p>
<p>In a next blog entry I'll go into how to encapsulate this logic behind a smart boo attribute.</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-05-16T21:58:32-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001567_boo_077_is_here.html">
<title>Boo 0.7.7 is here</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001567_boo_077_is_here.html</link>
<description><![CDATA[<p>Boo 0.7.7 is finally here!</p>

<p>With special thanks to Avishay Lavie, Cedric Vivier and all the nice people who contributed to this release: Andy Bulka, Arron Washington, Chris Peterson, Daniel Grunwald, Dominik Zablotny, Doug Holton, Hans-Christian Holm, J Bryan Kelly, Jaroslaw Kowalski, Joshua W. Biagio, Marcus Griep, mfowle, Miguel de Icaza, Posti Laatikko, Sergio Rubio, Snaury, Szymon Wrozynski.</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></p>

<p>Highlights for this release include:<br />
* More complete/stable generics support (now usable in WSA mode too).<br />
       * Support for using generic types with either external type parameters<br />
       (List of int) or internal ones (List of MyClass)<br />
       * Support for consuming generic methods.<br />
       * Generators and Iterators are now generic<br />
       * Support for the new "Type of *" syntax for referencing generic definitions.<br />
       * Improved type inference on generic types (this is work in progress).<br />
* Fixed bug with multiple symbols on the same line when debugging<br />
boo-generated assemblies.<br />
* Fixed checked/unchecked inconsistencies and added new<br />
"-checked[+/-]" option to booc.<br />
* String handling optimized and generates Gendarme/FXcop-compliant assemblies.<br />
* Automatic stub are now created when not implementing abstract<br />
orinterface methods from base class.<br />
* Verify pipeline is now available on Mono too.<br />
* Lots of other fixes and improvements</p>

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

<p>Best wishes and stay beautiful!</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2007-05-07T10:17:48-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001441_db4o_60_is_out.html">
<title>db4o 6.0 is out!</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001441_db4o_60_is_out.html</link>
<description><![CDATA[<p><a href="http://evain.net/blog/articles/2006/11/14/db4o-6-0-released">Feel the love!</a></p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2006-11-14T17:36:16-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001386_pair_programming_and_free_play.html">
<title>Pair Programming and Free Play</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001386_pair_programming_and_free_play.html</link>
<description><![CDATA[<p>I'm finally reading <a href="http://www.amazon.com/gp/product/0874776317/sr=8-1/qid=1156094481/ref=pd_bbs_1/103-5188688-8342231?ie=UTF8">Free Play</a> again. Always a pleasure.</p>

<p>I've also been pair programming a lot. Another pleasure:</p>

<p>"Some jobs are too big to handle alone, or simply more fun when done with friends. Either case leads us into the fruitful and challenging field of collaboration. Artists working together play out yet another aspect of the power of limits. There is another personality and style to pull with and push against. Each collaborator brings to the work a different set of strengths and resistances. We provide both irritation and inspiration for each other - the grist for each other's pearl making.</p>

<p>We need to remind ourselves here of what is obviously true but not often enough said: that different personality styles have different creative styles. There is no one idea of creativity that can describe it all. Therefore, in collaborating with others we round up, as in any relationship, an enlarged self, a more versatile creativity."</p>

<p>I could quote the whole chapter but hey, do yourself a favor and get the book.</p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2006-08-20T15:32:12-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001277_a_comparison_of_ruby_and_boo.html">
<title>A Comparison of Ruby and Boo</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001277_a_comparison_of_ruby_and_boo.html</link>
<description><![CDATA[<p>An <a href="http://www.cse.iitb.ac.in/~kart/writings/Ruby%20vs.%20Boo%20(long).html">interesting article by Kartik Vaddadi comparing Ruby and Boo</a>.</p>

<p>I found Boo's subtext "it is about the whole experience" quite present as I went through the article. Many runtime facilities were replaced by compiler extensibility facilities so tool support was not sacrificed.</p>

<p>It's always a good feeling when I start <a href="http://wiki.icsharpcode.net/default.aspx/SharpDevelop.SharpDevelop2xRoadmap">#develop 2.0</a> or <a href="http://www.monodevelop.org/Main_Page">MonoDevelop</a>.</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2005-12-18T13:56:49-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001268_cirque_du_soleil.html">
<title>Cirque du Soleil</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001268_cirque_du_soleil.html</link>
<description><![CDATA[<p>Just got back from Corteo. WOW! What an experience! I'm feeling really good. If you have the chance don't miss it.</p>

<p>And this is only two days after having the pleasure of listening to Charlie Haden's Liberation Orchestra live.</p>

<p>Yeah, I'm feeling really good.</p>]]></description>
<dc:subject>life</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2005-12-09T04:44:08-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001256_cecilflowanalysis_is_in.html">
<title>Cecil.FlowAnalysis is in</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001256_cecilflowanalysis_is_in.html</link>
<description><![CDATA[<p>I've just finished updating the <a href="http://www.mono-project.com/Cecil">cecil repository</a> with <a href="http://www.db4o.com/">our</a> latest contributions:<br />
<ul><li>Cecil.FlowAnalysis</li><li>a very humble but functional test suite</li></ul><br />
Have fun!</p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2005-11-29T22:14:31-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001248_prevayler_fud.html">
<title>Prevayler FUD</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001248_prevayler_fud.html</link>
<description><![CDATA[<p><a href="http://martinfowler.com/bliki/InMemoryDatabase.html">Martin Fowler blogged about in memory databases</a> and I could not help reading the excerpt about Prevayler at the end as FUD:<br />
<blockquote style="font-size: -1"><br />
<a href="http://www.prevayler.org/">Prevayler</a> got a lot of attention for taking this kind of approach. People I know who tried it found it's tight coupling to the in-memory objects and lack of migration tools caused serious problems.<br />
</blockquote><br />
There are two assertions there, let me take them apart:<br />
<ul><br />
<li><i>"People who tried it found its lack of migration tools caused serious problems."</i> I can definitely understand that. Object prevalence and related native object persistence technologies enable you to be so agile in your development that the lack of proper migration tools is irritating. That's why <a href="http://bbooprevalence.sourceforge.net/">Bamboo.Prevalence</a> includes a simple but effective migration tool out of the box.</li><br />
<li><i>"People who tried it found its tight coupling to the in-memory objects caused serious problems."</i> Well, tight coupling to in-memory objects is also called OOP in some circles. That's the single most important reason I would choose object prevalence technology whenever allowed by the project requirements. Ah, the things you are allowed to do when you get that intimate to your objects. </li><br />
</ul></p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2005-11-23T16:18:56-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001237_native_queries_under_the_hood.html">
<title>Native Queries (under the hood)</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001237_native_queries_under_the_hood.html</link>
<description><![CDATA[<p>
We are having a
<a href="http://thread.gmane.org/gmane.comp.windows.dotnet.castleproject.devel/4191">discussion about
NativeQueries on castleproject-devel</a> and I decided to wrap up the discussion here
by describing some of the details and shared goodies of <a href="http://www.db4o.com">our implementation</a>.
</p>

<p>
&gt; Can I assume that you're using the new GetMethodIL (or something like that)?
<br /><br />
We are using the <a href="http://www.mono-project.com/Cecil">Mono.Cecil</a> API not the reflection API.
<br /><br />
Simply because Cecil's version of GetMethodBody is so much better and it already worked on most
platforms we support. One of our first contributions was to get Cecil running on the Compact Framework.
After some conditional compilation fun (among other things) Cecil now works on mono, ms.net 1.1, ms.net 2.0, cf 1.0 and cf 2.0.
Pretty cool.
</p>
<p>
> This is just freaking cool. And the idea is awesome.
<br /><br />
Yeah, we think so too! (:
</p>
<p>
> If you cache the
> execution plans, I suppose you can get a very good performance out of it.
>
<br /><br />
Currently we are not even caching the execution plans and the performance it's pretty
close to the raw query execution performance one would get from the underlying query api. 
<br /><br />
But, yes, caching the execution plans (or transformed expression trees in our case) is
the next logical step.
</p>
<p>
> This is a whole different way of thinking about how to mess with the
> code...!
> I've only heard about Cecil until now, wasn't aware that it was operational
> on this level. Are there are docs yet, or is it read the code to find out?
> 
<br /><br />
The Cecil object model is pretty self documenting. 
<br /><br />
The code we are contributing to cecil is a little more involved but still easy
to follow if you stick to the public API.
<br /><br />
It basically allows you to get high level control flow graphs out of method
definitions. These high level cfgs can also contain decompiled expression trees
(an expression tree is a structure pretty similar to a bound boo ast).
<br /><br />
Here's a simple but complete example that uses Cecil and our contributed code (Cecil.FlowAnalysis) to
dump the body of a method:
<br /><br />
<style>
#content { top: 2.5em; background: #f7f7f7; border: 1px solid #aaa; font-family: Times New Roman, serif, Arial, sans-serif, Courier New, monospace; }
#content pre {margin:0; padding: .5em; font-family: Lucida Console, monospace; font-size: 12pt; }
#content span {margin:0; padding: 0; font-size: 12pt; }
.regionlicense { color: #7f0000}
.comment {color: #7f7f00; font-style: italic}
.string {color: #007f00;}
.string-interpol {color: #7f007f}
.string-line { color: #007f00}
.punctuation {color: DarkGreen}
.function {color: MidnightBlue}
.regex {color: Red}
.number {color: Magenta}
.keyword-access {font-weight: bold; color: Black}
.keyword-operator {font-weight: bold; color: DarkCyan}
.keyword-selection {font-weight: bold; color: Blue}
.keyword-iteration {font-weight: bold; color: Blue}
.keyword-jump {color: Navy}
.keyword-exception {font-weight: bold; color: Teal}
.keyword-checked {font-weight: bold; color: DarkGray}
.keyword-unsafe {color: Olive}
.keyword-value {font-weight: bold; color: Purple}
.keyword-reference {font-weight: bold; color: Purple}
.keyword-void {color: Red}
.keyword-conversion {font-weight: bold; color: Blue}
.keyword-modifier {color: Brown}
.keyword-visibility {font-weight: bold; color: Blue}
.keyword-namespace {font-weight: bold; color: Green}
.keyword-getset {color: SaddleBrown}
.keyword-literal {font-weight: bold; color: Black}
.keyword-macro {color: Maroon}
.keyword-builtin {color: Purple}
.keyword-method {font-weight: bold; color: Blue}
.keyword-pass {color: Gray}
.keyword-type {font-weight: bold; color: Blue}
</style>
<div id="content">
<pre><span class="l"><span class="keyword-namespace">import</span> <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystem.asp">System</a></span>
<span class="l"><span class="keyword-namespace">import</span> Mono<span class="punctuation">.</span>Cecil</span>
<span class="l"><span class="keyword-namespace">import</span> Cecil<span class="punctuation">.</span>FlowAnalysis</span>
<span class="l"><span class="keyword-namespace">import</span> Cecil<span class="punctuation">.</span>FlowAnalysis<span class="punctuation">.</span>ActionFlow</span>
<span class="l"><span class="keyword-namespace">import</span> Cecil<span class="punctuation">.</span>FlowAnalysis<span class="punctuation">.</span>CodeStructure</span>
<span class="l"></span>
<span class="l"><span class="keyword-type">class</span> Address<span class="punctuation">:</span></span>
<span class="l">    <span class="punctuation">[</span><span class="function">property</span><span class="punctuation">(</span>State<span class="punctuation">)</span><span class="punctuation">]</span></span>
<span class="l">    _state <span class="keyword-conversion">as</span> <span class="keyword-reference">string</span></span>
<span class="l">    </span>
<span class="l"><span class="keyword-type">class</span> Customer<span class="punctuation">:</span></span>
<span class="l">    <span class="punctuation">[</span><span class="function">property</span><span class="punctuation">(</span>Address<span class="punctuation">)</span><span class="punctuation">]</span></span>
<span class="l">    _address <span class="keyword-conversion">as</span> Address</span>
<span class="l">    </span>
<span class="l"><span class="keyword-type">class</span> Predicate<span class="punctuation">:</span></span>
<span class="l">    <span class="keyword-method">def</span> <span class="function">Match</span><span class="punctuation">(</span>c <span class="keyword-conversion">as</span> Customer<span class="punctuation">)</span><span class="punctuation">:</span></span>
<span class="l">        <span class="keyword-jump">return</span> c<span class="punctuation">.</span>Address<span class="punctuation">.</span>State <span class="punctuation">=</span><span class="punctuation">=</span> <span class="string">&quot;SP&quot;</span></span>

<span class="l"><span class="keyword-method">def</span> <span class="function">GetMatchMethod</span><span class="punctuation">(</span><span class="punctuation">)</span><span class="punctuation">:</span></span>
<span class="l">    asm <span class="punctuation">=</span> AssemblyFactory<span class="punctuation">.</span><span class="function">GetAssembly</span><span class="punctuation">(</span><span class="keyword-conversion">typeof</span><span class="punctuation">(</span>Predicate<span class="punctuation">)</span><span class="punctuation">.</span>Module<span class="punctuation">.</span>FullyQualifiedName<span class="punctuation">)</span></span>
<span class="l">    <span class="keyword-jump">return</span> asm<span class="punctuation">.</span>MainModule<span class="punctuation">.</span>Types<span class="punctuation">[</span><span class="string">&quot;Predicate&quot;</span><span class="punctuation">]</span><span class="punctuation">.</span>Methods<span class="punctuation">.</span><span class="function">GetMethod</span><span class="punctuation">(</span><span class="string">&quot;Match&quot;</span><span class="punctuation">)</span><span class="punctuation">[</span><span class="number">0</span><span class="punctuation">]</span></span>
<span class="l"></span>
<span class="l">cfg <span class="punctuation">=</span> FlowGraphFactory<span class="punctuation">.</span><span class="function">CreateControlFlowGraph</span><span class="punctuation">(</span><span class="function">GetMatchMethod</span><span class="punctuation">(</span><span class="punctuation">)</span><span class="punctuation">)</span></span>
<span class="l"><span class="comment">// a cfg is at the IL instruction level it is good for</span></span>
<span class="l"><span class="comment">// low level IL optimization and simple analysis</span></span>
<span class="l"></span>
<span class="l">afg <span class="punctuation">=</span> FlowGraphFactory<span class="punctuation">.</span><span class="function">CreateActionFlowGraph</span><span class="punctuation">(</span>cfg<span class="punctuation">)</span></span>
<span class="l"><span class="comment">// an afg is at the statement/expression level</span></span>
<span class="l"><span class="comment">// good for code analysis</span></span>
<span class="l"></span>
<span class="l"><span class="comment">// print the interesting blocks</span></span>
<span class="l"><span class="keyword-iteration">for</span> block <span class="keyword-iteration">in</span> afg<span class="punctuation">.</span>Blocks<span class="punctuation">:</span></span>
<span class="l">    expression <span class="keyword-conversion">as</span> IExpression <span class="punctuation">=</span> <span class="keyword-literal">null</span></span>
<span class="l">    </span>
<span class="l">    <span class="keyword-selection">if</span> block <span class="keyword-operator">isa</span> IReturnActionBlock<span class="punctuation">:</span></span>
<span class="l">        expression <span class="punctuation">=</span> <span class="punctuation">(</span>block <span class="keyword-conversion">as</span> IReturnActionBlock<span class="punctuation">)</span><span class="punctuation">.</span>Expression</span>
<span class="l">        Console<span class="punctuation">.</span><span class="function">Write</span><span class="punctuation">(</span><span class="string">&quot;return &quot;</span><span class="punctuation">)</span></span>
<span class="l">    <span class="keyword-selection">elif</span> block <span class="keyword-operator">isa</span> IAssignActionBlock<span class="punctuation">:</span></span>
<span class="l">        expression <span class="punctuation">=</span> <span class="punctuation">(</span>block <span class="keyword-conversion">as</span> IAssignActionBlock<span class="punctuation">)</span><span class="punctuation">.</span>AssignExpression</span>
<span class="l">        </span>
<span class="l">    <span class="keyword-jump">continue</span> <span class="keyword-selection">if</span> expression <span class="keyword-operator">is</span> <span class="keyword-literal">null</span></span>
<span class="l">    </span>
<span class="l">    <span class="comment">// expression is an ast like expression tree</span></span>
<span class="l">    <span class="comment">// which supports visitors</span></span>
<span class="l">    <span class="comment">// it is more like a bound ast (with all references</span></span>
<span class="l">    <span class="comment">// pointing to the right Mono.Cecil entities)</span></span>
<span class="l">    <span class="comment">//</span></span>

<span class="l">    <span class="comment">// ExpressionPrinter is a handy visitor</span></span>
<span class="l">    <span class="keyword-builtin">print</span> ExpressionPrinter<span class="punctuation">.</span><span class="function">ToString</span><span class="punctuation">(</span>expression<span class="punctuation">)</span></span>
</pre>
</div>
<p>
The code above will print:
<pre>
    local0 = string.op_Equality(c.get_Address().get_State(), "SP")
    return local0
</pre>
Going from that to a high performant query native to the underlying engine is a fun ride!]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2005-11-17T11:14:44-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001234_running_breezy_now.html">
<title>running breezy now</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001234_running_breezy_now.html</link>
<description><![CDATA[<p>Ubuntu breezy installed without a hiccup on my AMD64. Then jdk 5, eclipse and skype.</p>

<p>Fingers crossed to install vmware player... What a nice surprise!</p>

<p>I simply ran the installer script and it worked!</p>

<p>So now I'm back to having linux as my main environment with Windows virtual machines.</p>

<p>What a nice day! Let's see how mono goes...</p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2005-11-15T23:23:11-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001219_miguel_bamboo_and_anders.html">
<title>Miguel, Bamboo and Anders</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001219_miguel_bamboo_and_anders.html</link>
<description><![CDATA[<p>I still have to blog about my great PDC experience but here it goes a quickie.</p>

<p>Anders having fun with boo and mono (or Miguel having fun with boo and c# or Bamboo having fun with mono and c#):</p>

<p><image src="http://priki.org/~rodrigob/miguel_bamboo_anders.jpg"></p>]]></description>
<dc:subject>life</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2005-11-04T19:55:42-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001210_static_typing_is_not_about_safety.html">
<title>static typing is not about safety</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001210_static_typing_is_not_about_safety.html</link>
<description><![CDATA[<p>Via <a href="http://martinfowler.com/bliki/OOPSLA2005.html">Martin Fowler</a>:<br />
"""<br />
Static types give me the same feeling of safety as the announcement that my seat cushion can be used as a floatation device.</p>

<p>--Don Roberts<br />
"""</p>

<p>Most people seem to think of static typing mainly as a safety net. I even had used that same term <a href="http://boo.codehaus.org/BooManifesto.pdf">before</a>. Well, as it turns out static typing is mainly about providing two things:</p>

<ul>
<li><b>better tools</b>: editing tools (think code completion), code navigation tools (think 'show type hierarchy', 'call hierarchy', 'goto base method'), refactoring tools (think 'rename', 'change signature');</li>
<li>
<b>better performance:</b> compilers, optimizers and the runtime environment can do a much better job when type information is available (and do it much faster);
</li>
</ul>

<p>And that's why boo is statically typed, because is the whole experience that counts.</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2005-10-27T10:05:27-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001195_free_culture.html">
<title>Free Culture</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001195_free_culture.html</link>
<description><![CDATA[<p>Thank you <a href="http://lessig.org/freeculture/free.html">Lessig</a>!</p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2005-10-15T22:52:02-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001167_mono_meeting_at_the_microsoft_pdc.html">
<title>Mono Meeting at the Microsoft PDC</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001167_mono_meeting_at_the_microsoft_pdc.html</link>
<description><![CDATA[<p>Count me <a href='http://www.mono-project.com/news/archive/2005/Sep-06.html'>in</a>.</p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2005-09-06T17:26:39-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001146_eclipseness.html">
<title>eclipseness</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001146_eclipseness.html</link>
<description><![CDATA[<p>
Georges and I have been working on a set of eclipse plugins for boo development. There are several reasons I decided to give eclipse a try:
<ul>
<li>I've been spending the last year working pretty much 50/50 on java and .net projects - this is to say that I've been using eclipse a lot and got used to it;</li>
<li>I've also been in charge of writing some eclipse plugins so I got the expertise;</li>
<li>eclipse's architecture is pretty well thought out (I'm not saying the other ides' out there are not - I'm only familiar with eclipse's);</li>
<li>there are lots of plugins out there and lots of information about writing eclipse plugins - I'm sure you will agree this is in clear contrast with the other environments;</li>
<li>the PDE environment is pretty mature and TDD plugin development is a reality;</li>
<li>lots of other tools/frameworks/languages are already eclipsed and we get those for free: java, c++, antlr, cvs, svn, python, ruby, byecycle...</li>
<li>I need a pleasant and smoother cross platform experience as I develop software for different platforms: we have already used the plugins under windows, linux and macosx and everything worked like a charm (well, sort of :));
</ul>
</p>
<p>
What we already have:
<ul>
<li>syntax highlighting (and of course we inherit most of eclipse's editing features like editor navigation and history);</li>
<li>boo projects;</li>
<li>background builders which report errors as you save the files;</li>
<li>local library references, gac references and internal project references (I would have to explain a little more);</li>
<li>launching (run as boo application, run as boo script);</li>
<li>nunit integration (run as nunit test);</li>
<li>interactive interpreter with code completion;</li>
<li>stack trace navigation (click on a file:line information and have that file open in the editor);</li>
</ul>
</p>
<p>
It's already ok for my everyday, cross platform use but YMMV as usual.
<br />
<br />
The glorious screenshots (click to enlarge):
</p>

<p>
<a target="screenshot" href="http://priki.org/~rodrigob/BooPerspectiveUbuntu.png" title="click to enlarge">
<img width="320" height="200" src="http://priki.org/~rodrigob/BooPerspectiveUbuntu.png" />
</a><br />
The contributed boo perspective on my ubuntu system
</p>

<p>
<a target="screenshot" href="http://priki.org/~rodrigob/BooPerspective.png" title="click to enlarge">
<img width="320" height="200" src="http://priki.org/~rodrigob/BooPerspective.png" />
</a><br />
The background builder reports errors and warnings as you save the files
</p>

<p>
<a target="screenshot" href="http://priki.org/~rodrigob/CodeCompletionMacOSX.png" title="click to enlarge">
<img width="320" height="200" src="http://priki.org/~rodrigob/CodeCompletionMacOSX.png" />
</a><br />
Some MacOSX love from Georges
</p>

<p>
<a target="screenshot" href="http://priki.org/~rodrigob/CodeCompletionUbuntu.png" title="click to enlarge">
<img width="320" height="200" src="http://priki.org/~rodrigob/CodeCompletionUbuntu.png" />
</a><br />
Code completion on my ubuntu system
</p>

<p>
<a target="screenshot" href="http://priki.org/~rodrigob/NUnitWindows.png" title="click to enlarge">
<img width="320" height="200" src="http://priki.org/~rodrigob/NUnitWindows.png" />
</a><br />
NUnit integration (running on windows)
</p>

<p>The plugins will move to the boo repository soon. Stay tuned.</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2005-08-05T20:22:06-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001145_going_to_the_pdc.html">
<title>Going to the PDC</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001145_going_to_the_pdc.html</link>
<description><![CDATA[<p>Working for <a href="http://www.db4o.com/">db4o</a> is really a joy.</p>

<p>Not only I get to work on a great product which is changing and will keep changing the way many people<br />
develop software but also get to work and talk with very smart guys very frequently.</p>

<p>And now for the extra sugar they are sponsoring my trip to the <a href="http://msdn.microsoft.com/events/pdc/">PDC</a>. </p>

<p>So if are you going to the PDC and want to exchange some ideas on object oriented databases,<br />
agile programming languages,  agile software development, drumming and/or lucid dreaming,<br />
let me know! </p>]]></description>
<dc:subject>life</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2005-08-05T17:52:21-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001133_the_father_of_c_talks_about_boo.html">
<title>The father of C# talks about boo...</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001133_the_father_of_c_talks_about_boo.html</link>
<description><![CDATA[<p>http://www.microsoft-watch.com/article2/0,2180,1837434,00.asp</p>

<p>"Then I say, is it really necessary to have such strong typing in the name of tersity? I don't think it is, necessarily.</p>

<p>I actually think that an even better world is a world where (a language) is terse, but it is still strongly typed."</p>

<p>Agreed, Anders :)</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2005-07-15T14:51:06-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001127_byecycle_aesthetic_programming_for_eclipse.html">
<title>Byecycle - Aesthetic Programming for Eclipse</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001127_byecycle_aesthetic_programming_for_eclipse.html</link>
<description><![CDATA[<p>Byecycle is an auto-arranging dependency analysis plug-in for Eclipse. Its goal is to make you feel sick when you see bad code and to make you feel happy when you see good code.</p>

<p>Visit the <a href='http://byecycle.sourceforge.net/'>Byecycle home page</a> for more details.</p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2005-07-04T11:22:37-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001084_subtext.html">
<title>subtext</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001084_subtext.html</link>
<description><![CDATA[<p>Yeah. <a href="http://subtextual.org/demo1.html">This</a> got me thinking. Thanks.</p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2005-05-13T01:36:40-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/001016_vmware_on_suse_92amd64_absolutely_rocks.html">
<title>VMWare on SuSE 9.2/AMD64 absolutely rocks</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/001016_vmware_on_suse_92amd64_absolutely_rocks.html</link>
<description><![CDATA[<p>I had to write an eclipse plugin some time ago. I just can't live without TDD. TDD with eclipse plugins is a pain in the neck because of eclipse startup and execution times. In my old development machine (a PIV 2.2Mhz notebook), the entire test suite takes 125 seconds to run. After weeks of intensive development I figured I had two options either buy a faster workstation or  go nuts.</p>

<p>I bought myself a AMD64 3200+ workstation.</p>

<p>Here's the time figures for the different development environments I tried:</p>

<p>Notebook, Windows XP Home, Eclipse 3.1, jdk 1.5.0_01 (client vm): <b>125.7s</b><br />
Workstation, Windows XP Pro, Eclipse 3.1, jdk 1.5.0_01 (client vm): <b>57.8s</b><br />
Workstation, Windows XP Pro, Eclipse 3.1, jdk 1.5.0_01 (server vm): <b>61.3s</b><br />
Workstation, SuSE 9.2 64bit, Eclipse 3.1, jdk 1.5.0_01 64bit (server vm): <b>61s</b><br />
Workstation, SuSE 9.2 32bit inside VMWare running on SuSE 9.2 64bit, jdk 1.5.0_02 32bit (client vm): <b>59.2s</b></p>

<p>I find absolutely amazing that running eclipse inside a 32bit SuSE 9.2 VMWare under SuSE 9.2 64bit runs at the same speed of eclipse under Windows XP Pro. </p>

<p>These VMWare guys really know what they are doing. </p>

<p><p><b>Quick update: </b>I've just tried running the smae SuSE 9.2 32bit inside a VMWare running on <b>Windows XP Pro 64bit</b> and the full test suite took only <b>57s</b>!!!! So it seems that I've finally found my development enviroment setup.</p></p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2005-03-19T14:44:37-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000988_boo_05_is_here.html">
<title>boo 0.5 is here</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000988_boo_05_is_here.html</link>
<description><![CDATA[<p>Spread the word, boo 0.5 is out!!</p>

<p>Lots of <a href="http://boo.codehaus.org/Release+Notes">goodies</a> in this release.</p>

<p>Thanks to the growing boo community for making this ride so fun. </p>

<p>Special thanks go in random moustache size order to *Daniel Grunwald*, *Ian MacLean*, *Latexer*, *Bill Wood*, *Doug Holton*, *Aaron Washington* and *Scott Fleckenstein*.</p>

<p>Hey you all, have fun!</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2005-02-17T22:49:10-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000983_db4oboobrowser_is_online.html">
<title>db4oboobrowser is online</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000983_db4oboobrowser_is_online.html</link>
<description><![CDATA[<p>What happens when you mix a developer looking for some fun, a <a href="http://www.db4o.com/">great open source object database engine</a> and a <a href="http://boo.codehaus.org/">wrist friendly programming language</a>?</p>

<p>I tell you what happens: <a href="http://db4oboobrowser.sourceforge.net/">db4o boo object browser</a.</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2005-02-14T15:00:25-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000968_database_atrophy.html">
<title>Database Atrophy</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000968_database_atrophy.html</link>
<description><![CDATA[<p>"You have to understand that most of these people are not ready to be unplugged. And many of them are so inurred, so hopelessly dependent on the system, that they will fight to protect it.</p>

<p>...</p>

<p>Yet, their strength and their speed are still based in a world that is built on rules.<br />
Because of that, they will never be as strong or as fast as you can be."</p>

<p>Yes, Klaus is finally <a href="http://www.people4objects.org/Klaus/">blogging</a>.</p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2005-01-31T11:30:18-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000955_nested_types_dont_work_on_net_20.html">
<title>Nested types dont work on .net 2.0</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000955_nested_types_dont_work_on_net_20.html</link>
<description><![CDATA[<p><p><br />
I just can't buy this "we don't have resources to fix it before Whidbey" shit. Come on!!!! You're f$#$@#$ Microsoft! You have billions of dollars. Hire someone else to <a href="http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx?feedbackid=5984e7ff-4a8f-4096-bff9-b459fcd14e89">fix it</a>.<br /><br /><br />
What are you looking at??!?!?<br />
</p></p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2005-01-15T17:49:40-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000942_boo_in_2005.html">
<title>boo in 2005</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000942_boo_in_2005.html</link>
<description><![CDATA[<p><p><br />
<b>Happy new year everybody!</p></p>

<p>Some things boo related I'd like to see in 2005.</p>

<p><h3>boo in boo</h3></p>

<p>metaboo?</p>

<p>I want to have the Boo.Lang.Compiler assembly "ported" to boo.</p>

<p>Boo.Lang.Interpreter would be merged with it in the process and we might even gain eval, compile, exec, locals builtins in the process :)</p>

<p>In the process we would also incorporate the necessary improvements to finally being able to use the case insensitive dialect (or the white space agnostic one).</p>

<p><h3>better type inference</h3></p>

<p>The current system fails to infer types on recursive definitions.</p>

<p><h3>generics</h3></p>

<p>I'd really would like to hear some thoughts on this one. But my intention is to start boo in boo from day one having .net 2.0 (mono 2.0 profile) as a requirement.</p>

<p><h3>eclipse-like experience</h3></p>

<p>After spending some time with java and eclipse it was clear to me that it is all about the experience. The eclipse IDE can make even a verbose and limited language like java seem very useable.</p>

<p>What I really would like to see in a boo focused IDE:<br />
<ul><li>refactoring support: "rename type/field/method/event" and "extract method" are my favorite ones</li><li>call hierarchy browser</li><li>find unused methods/types/fields</li></ul></p>

<p>The nice thing is that this is so easy to implement :D</p>

<p>Ok, maybe not <b>so</b> easy but who doesn't like a challenge for a change?</p>

<p>I'm not sure if SharpDevelop is the way to go though...<br />
</p></p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2005-01-03T18:42:44-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000930_vsnet_language_binding_walkthrough.html">
<title>VS.NET language binding walkthrough</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000930_vsnet_language_binding_walkthrough.html</link>
<description><![CDATA[<p><a href="http://blogs.msdn.com/cyrusn/archive/2004/12/15/316617.aspx">This</a> looks interesting.</p>

<p>Interesting... What about a boo language service for VS.NET?</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-12-17T15:33:15-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000926_sharpdevelop_and_boo_looking_good.html">
<title>SharpDevelop and boo - looking good</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000926_sharpdevelop_and_boo_looking_good.html</link>
<description><![CDATA[<p><img src="http://www.digitalcraftsmen.com.br/~rodrigob/sd_shot.png" /></p>

<p>Class viewer, code folding, code completion and a boo interactive console. Life is good indeed!</p>

<p>Kudos to Daniel Grunwald.</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-12-13T17:31:21-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000919_compiler_pipelines_and_compiler_profiles.html">
<title>Compiler pipelines and compiler profiles</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000919_compiler_pipelines_and_compiler_profiles.html</link>
<description><![CDATA[<p>
<p>
A compiler pipeline is a named sequence of compiler steps. Pipelines are like compilation recipes: CompileToFile, CompileToMemory, Parse, ResolveExpressions, etc.
</p>
<p>
The good thing about the pipeline abstraction is that it is pretty easy to hook into the compilation process to do all sort of things (see how easy it was to implement the interactive interpreter).
</p>
<p>
The bad thing about the way pipelines are implemented today is that if you want to customize, let's say, the parser (maybe you don't like syntactically significant white space), you have to change every single pipeline your application is going to use. For a clear example of why the current pipelien architecture is bad, think of the Boo Explorer application. It uses 3 pipeline definitions: 
<ul>
<li>Parse: for the document outline view</li>
<li>ResolveExpressions: code completion</li>
<li>InteractiveInterpreter custom pipeline</li>
</ul>
</p>
<p>
Now imagine that you want to use your custom parser step with boox. How would you do it? See the problem? You would have to change code in a lot of places (inside and outside boox!) just to plug in your custom parser.
</p>
<p>
Another use case would be making boo case insensitive (Hi Doug!).
</p>
<p>
I was talking about this with Carl Rosenberger (<a href="http://www.db4objects.com/">db4o</a>) and he asked me what the problem was :). He replied with something along these lines: "just use some sort of dictionary to hold all the configurable services and make the pipelines aware of it".
</p>
<p>
Simple.
</p>
<p>
Let's baptize this glorified dictionary then: Compiler Profile.
<br /><br />
A compiler profile represents a set of services that should be used by any given compiler pipeline. Each service in a profile is identified by a well known name (it's not yet clear to me if the name will be something like a string or a System.Type reference). I see the following services right now:
<ul>
<li>Parser - don't like to rely on white space?</li>
<li>Comparer </li>
<li>OverloadResolutionService - want to implement different rules for overloaded methods resolution?</li>
<li>TypeSystemServices - want different builtin type names? Different type compatibility rules?</li>
</ul>
</p>
<p>
The good thing about this model is that a specific service or profile could be even specified in the command line:
<pre>
	booc -profile:caseinsensitive foo.boo
	boox -service parser:MyCustomParser,MyCustomAssembly foo.boo
</pre>
</p>
<p>
The way I see it it should be very easy to write a, let's say, vb.net compiler based on boo just by providing the right services.
</p>
<p>
I plan to include this profile thing in the next major refactoring when I'll translate Boo.Lang.Compiler from c# to boo.

Thoughts?
</p>
</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-12-10T16:04:25-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000895_sovereign_computing.html">
<title>Sovereign Computing</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000895_sovereign_computing.html</link>
<description><![CDATA[<p>
From the looney who came up with <a href='http://www.prevayler.org/'>prevayler</a>:
<a href='http://www.advogato.org/article/808.html'>Sovereign Computing</a>.
<br />
<br />
Are you ready to join the crowd and make it happen? Too scared?
<br />
<br />
<a href='http://www.advogato.org/article/808.html'>Sovereign Computing</a>
</p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-11-23T08:18:40-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000894_dont_panic.html">
<title>DON&apos;T PANIC</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000894_dont_panic.html</link>
<description><![CDATA[<p>
<a href='http://hitchhikermovie.free.fr/pages/trailerdownload.html'>Nice teaser</a> but I just can't wait to see Sam Rockwell playing Zaphod.
</p>]]></description>
<dc:subject>culture</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-11-23T07:45:11-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000888_booish_meets_java_ii.html">
<title>booish meets java II</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000888_booish_meets_java_ii.html</link>
<description><![CDATA[Doug reminded me that we don't actually need the jbooish stub to explore the java libraries:
<br /><br />
<pre style="background-color:black; color:white; font-weight: bold; font-family: Courier New; padding: 4px;">
$ ./booish
>>> load("d:/dotnet/ikvm/bin/IKVM.GNU.Classpath.dll")
>>> import java.lang
>>> System.getProperty("java.vendor")
'Jeroen Frijters'
>>>
</pre>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-11-11T21:35:31-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000887_booish_meets_java.html">
<title>booish meets java</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000887_booish_meets_java.html</link>
<description><![CDATA[<pre style="background-color: black; color: white; padding: 4px; font-family: courier new; font-weight: bold">
rodrigob@bambook /cygdrive/d/dev/boo/build
$ ./ikvm -classpath "booish.jar;." jbooish
>>> v = Class.forName("java.util.Vector").newInstance()
[]
>>> v.add("Hello")
true
>>> v.add("Java!")
true
>>> v
[Hello, Java!]
>>>
</pre>
<br />
<br />
<b>How to</b>
<ol>
<li>download <a href="http://www.ikvm.net/">ikvm</a></li>
<li>unpack the binaries to your boo build or bin directory</li>
<li>ikvmstub booish.exe</li>
<li>create a little java stub that instantiates booish.InteractiveInterpreter, let's call it jbooish, mine is at the end of this entry</li>
<li>javac -classpath "$CLASSPATH;.;booish.jar" jbooish.java</li>
<li>./ikvm -classpath "booish.jar;." jbooish</li>
<li>boo your way through the java libraries!</li>
</ol>
Is this nice or what? Now I get to work with boo even when I work with java.
<br />
<br />
<b>jbooish.java</b>
<pre>
import cli.booish.InteractiveInterpreter;

public class jbooish {
    public static void main(String[] args) {
        InteractiveInterpreter interpreter = new InteractiveInterpreter();
        interpreter.set_RememberLastValue(true);
        interpreter.SetValue("Class", jbooish.class);
        interpreter.ConsoleLoopEval();
    }
}
</pre>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-11-11T19:27:19-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000886_it_feels_like_the_old_c_days.html">
<title>it feels like the old c++ days</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000886_it_feels_like_the_old_c_days.html</link>
<description><![CDATA[I did fell in love with java once.
<br><br>
I guess that after years of <b>reinterpret_cast&lt;void**&gt;(&spUnk.p)</b>, java seemed like nothing but a beautiful sunday morning.
<br><br>
<b>Reading a char array from a file the java way</b>
<pre><code>    public static char[] readChars(File file) throws IOException {
        FileInputStream stream = new FileInputStream(file);
        try {            
            // HACK: assume 1 byte per char
            char[] buffer = new char[(int)file.length()];            
            InputStreamReader reader = new InputStreamReader(stream);
            reader.read(buffer);
            return buffer;
        } finally {
            stream.close();
        }
    }

</code>
</pre>
<b>Reading a char array from a file the .net way</b>
<pre><code>def readChars(fname as string):
    using reader=File.OpenText(fname):
        return reader.ReadToEnd().ToCharArray()

</code>
</pre>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-11-11T09:17:05-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000883_java_api_quirk_of_the_day.html">
<title>java api quirk of the day</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000883_java_api_quirk_of_the_day.html</link>
<description><![CDATA[<p><b>Q.</b> How do you get a list of files matching a specific wildcard?<br />
<b>A.</b> java.io.File.listFiles(FilenameFilter)</p>

<p>FilenameFilter??? What's wrong with Directory.GetFiles("*.boo")?</p>

<p>And by the way we don't even have a java.io.Directory, it's everything on java.io.File. F#?%#!a a...</p>

<p>Ok, let's just breath... I'll need my yoga classes more than ever now that I'll be doing lots of java.</p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-11-10T09:37:51-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000881_eclipse_jdt_is_deja_vu_all_over.html">
<title>Eclipse JDT is déjà vu all over</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000881_eclipse_jdt_is_deja_vu_all_over.html</link>
<description><![CDATA[<p>I'm working a lot with the Eclipse JDT core model lately (yes, yes, I confess, I'm doing lots of java lately :-)).</p>

<p>I find it amazing how the Eclipse AST model is similar to one of the first AST models I designed for the boo compiler. Even some classes and interfaces have the same name (!!). The déjà vu climax was org.eclipse.jdt.core.dom.IBinding. It's been a long time (+8 months) since I renamed <a href='http://svn.boo.codehaus.org/trunk/src/Boo/Lang/Compiler/Bindings/IBinding.cs?rev=261&view=auto'>IBinding</a> to IEntity but still...</p>

<p>Do we have an explanation to that? Strikingly similar artifacts created independently of each other.</p>

<p>Patterns of software? or patterns of the nature itself?</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-11-09T11:33:40-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000872_and_apparently_gwb_pulled_it_off_again.html">
<title>And apparently GWB pulled it off again...</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000872_and_apparently_gwb_pulled_it_off_again.html</link>
<description><![CDATA[Amen, <a href="http://jroller.com/page/hammett?anchor=more_years_of_uncertainty">Hammett</a>.]]></description>
<dc:subject>life</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-11-03T09:27:47-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000868_debugging_boo_code.html">
<title>debugging boo code</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000868_debugging_boo_code.html</link>
<description><![CDATA[<p>
After tweaking the EmitAssembly.EmitDebugInfo code a little I was able to get the debugger running.
</p>
<p>
<p>
Not for me but I know some people that just can't live without decent debugging capabilities... Now they can try boo and debug away.
<br /><br />
Here's a shot of examples/fibonacci.boo being debugged:<br /><br />
<img src="http://boo.codehaus.org/debugging.png" />
</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-10-29T03:16:32-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000857_interactiveinterpreter_meets_gtk.html">
<title>InteractiveInterpreter meets Gtk</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000857_interactiveinterpreter_meets_gtk.html</link>
<description><![CDATA[<p>
<img src="http://boo.codehaus.org/gtkshell.png" />
</p>
<p>The source code is <a href="http://svn.boo.codehaus.org/trunk/examples/gtkshell.boo?view=markup">here</a>
</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-10-10T21:32:59-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000853_systemwindowsforms_meets_booish.html">
<title>System.Windows.Forms meets booish</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000853_systemwindowsforms_meets_booish.html</link>
<description><![CDATA[<img src="http://boo.codehaus.org/booish.jpg" />]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-10-08T00:42:57-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000851_woohoo_booish_is_alive.html">
<title>woohoo! booish is alive!</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000851_woohoo_booish_is_alive.html</link>
<description><![CDATA[<pre style="background-color: black; color: white; font-family: courier; padding: 10px">
$ booi extras/booish/booish.boo
>>> e = i*2 for i in range(3)
>>> print(join(e))
0 2 4
>>> a = 2**4
>>> print(a)
16
>>> ^Z
</pre>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-10-06T20:49:06-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000850_towards_a_boo_interactive_shell.html">
<title>towards a boo interactive shell</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000850_towards_a_boo_interactive_shell.html</link>
<description><![CDATA[<p>
Interactive language shells are cool. If you don't agree go read something else.<br /><br />
An interactive boo shell is probably the number one request I receive and finally the good news is that yesterday as I was leaving the elevator I had this very clear vision on how I could implement it. The great news is that it won't be too hard. In fact, if you compile boo from the subversion repository you can already take a look at the initial design of the <b>InteractiveInterpreter</b> class in the src/booish directory. 
<br /><br />
Sample code? ok. Here it goes:
<PRE>interpreter <FONT COLOR="#000000"><STRONG>=</STRONG></FONT> InteractiveInterpreter<FONT COLOR="#000000"><STRONG>(</STRONG></FONT><FONT COLOR="#000000"><STRONG>)</STRONG></FONT>
interpreter.SetValue<FONT COLOR="#000000"><STRONG>(</STRONG></FONT><FONT COLOR="#ff00cc">&quot;</FONT><FONT COLOR="#ff00cc">name</FONT><FONT COLOR="#ff00cc">&quot;</FONT>, <FONT COLOR="#ff00cc">&quot;</FONT><FONT COLOR="#ff00cc">boo</FONT><FONT COLOR="#ff00cc">&quot;</FONT><FONT COLOR="#000000"><STRONG>)</STRONG></FONT>
interpreter.SetValue<FONT COLOR="#000000"><STRONG>(</STRONG></FONT><FONT COLOR="#ff00cc">&quot;</FONT><FONT COLOR="#ff00cc">age</FONT><FONT COLOR="#ff00cc">&quot;</FONT>, <FONT COLOR="#ff0000">3</FONT><FONT COLOR="#000000"><STRONG>)</STRONG></FONT>

interpreter.Eval<FONT COLOR="#000000"><STRONG>(</STRONG></FONT><FONT COLOR="#ff00cc">&quot;&quot;&quot;</FONT>
<FONT COLOR="#ff00cc">print</FONT><FONT COLOR="#ff00cc">(</FONT><FONT COLOR="#ff00cc">name</FONT><FONT COLOR="#ff00cc">)</FONT>
<FONT COLOR="#ff00cc">print</FONT><FONT COLOR="#ff00cc">(</FONT><FONT COLOR="#ff00cc">age</FONT><FONT COLOR="#ff00cc">)</FONT>
<FONT COLOR="#ff00cc">age</FONT><FONT COLOR="#ff00cc"> </FONT><FONT COLOR="#ff00cc">+</FONT><FONT COLOR="#ff00cc">=</FONT><FONT COLOR="#ff00cc"> </FONT><FONT COLOR="#ff00cc">1</FONT>
<FONT COLOR="#ff00cc">&quot;&quot;&quot;</FONT><FONT COLOR="#000000"><STRONG>)</STRONG></FONT>

<FONT COLOR="#0099ff"><STRONG>assert</STRONG></FONT> <FONT COLOR="#ff0000">4</FONT> <FONT COLOR="#000000"><STRONG>=</STRONG></FONT><FONT COLOR="#000000"><STRONG>=</STRONG></FONT> interpreter.GetValue<FONT COLOR="#000000"><STRONG>(</STRONG></FONT><FONT COLOR="#ff00cc">&quot;</FONT><FONT COLOR="#ff00cc">age</FONT><FONT COLOR="#ff00cc">&quot;</FONT><FONT COLOR="#000000"><STRONG>)</STRONG></FONT>

interpreter.Eval<FONT COLOR="#000000"><STRONG>(</STRONG></FONT><FONT COLOR="#ff00cc">&quot;</FONT><FONT COLOR="#ff00cc">age</FONT><FONT COLOR="#ff00cc"> </FONT><FONT COLOR="#ff00cc">=</FONT><FONT COLOR="#ff00cc"> </FONT><FONT COLOR="#ff00cc">42</FONT><FONT COLOR="#ff00cc">&quot;</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> interpreter.GetValue<FONT COLOR="#000000"><STRONG>(</STRONG></FONT><FONT COLOR="#ff00cc">&quot;</FONT><FONT COLOR="#ff00cc">age</FONT><FONT COLOR="#ff00cc">&quot;</FONT><FONT COLOR="#000000"><STRONG>)</STRONG></FONT>

interpreter.Eval<FONT COLOR="#000000"><STRONG>(</STRONG></FONT><FONT COLOR="#ff00cc">&quot;&quot;&quot;</FONT>
<FONT COLOR="#ff00cc">value</FONT><FONT COLOR="#ff00cc"> </FONT><FONT COLOR="#ff00cc">=</FONT><FONT COLOR="#ff00cc"> </FONT><FONT COLOR="#ff00cc">3</FONT>
<FONT COLOR="#ff00cc">print</FONT><FONT COLOR="#ff00cc">(</FONT><FONT COLOR="#ff00cc">value</FONT><FONT COLOR="#ff00cc">*</FONT><FONT COLOR="#ff00cc">2</FONT><FONT COLOR="#ff00cc">)</FONT>
<FONT COLOR="#ff00cc">&quot;&quot;&quot;</FONT><FONT COLOR="#000000"><STRONG>)</STRONG></FONT>

<FONT COLOR="#0099ff"><STRONG>assert</STRONG></FONT> <FONT COLOR="#ff0000">3</FONT> <FONT COLOR="#000000"><STRONG>=</STRONG></FONT><FONT COLOR="#000000"><STRONG>=</STRONG></FONT> interpreter.GetValue<FONT COLOR="#000000"><STRONG>(</STRONG></FONT><FONT COLOR="#ff00cc">&quot;</FONT><FONT COLOR="#ff00cc">value</FONT><FONT COLOR="#ff00cc">&quot;</FONT><FONT COLOR="#000000"><STRONG>)</STRONG></FONT>

interpreter.Eval<FONT COLOR="#000000"><STRONG>(</STRONG></FONT><FONT COLOR="#ff00cc">&quot;</FONT><FONT COLOR="#ff00cc">x2</FONT><FONT COLOR="#ff00cc"> </FONT><FONT COLOR="#ff00cc">=</FONT><FONT COLOR="#ff00cc"> </FONT><FONT COLOR="#ff00cc">{</FONT><FONT COLOR="#ff00cc"> </FONT><FONT COLOR="#ff00cc">return</FONT><FONT COLOR="#ff00cc"> </FONT><FONT COLOR="#ff00cc">value</FONT><FONT COLOR="#ff00cc"> </FONT><FONT COLOR="#ff00cc">}</FONT><FONT COLOR="#ff00cc">&quot;</FONT><FONT COLOR="#000000"><STRONG>)</STRONG></FONT>

x2 <FONT COLOR="#006699"><STRONG>as</STRONG></FONT> <FONT COLOR="#006699"><STRONG>callable</STRONG></FONT> <FONT COLOR="#000000"><STRONG>=</STRONG></FONT> interpreter.GetValue<FONT COLOR="#000000"><STRONG>(</STRONG></FONT><FONT COLOR="#ff00cc">&quot;</FONT><FONT COLOR="#ff00cc">x2</FONT><FONT COLOR="#ff00cc">&quot;</FONT><FONT COLOR="#000000"><STRONG>)</STRONG></FONT>
<FONT COLOR="#0099ff"><STRONG>assert</STRONG></FONT> <FONT COLOR="#ff0000">3</FONT> <FONT COLOR="#000000"><STRONG>=</STRONG></FONT><FONT COLOR="#000000"><STRONG>=</STRONG></FONT> x2<FONT COLOR="#000000"><STRONG>(</STRONG></FONT><FONT COLOR="#000000"><STRONG>)</STRONG></FONT>

</PRE>
cool, eh?<br />
 Maybe you'll start using boo now, hammett? ;-)
</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-10-06T16:37:41-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000849_tableless_crossbrowser_menu_thing.html">
<title>tableless cross-browser menu thing</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000849_tableless_crossbrowser_menu_thing.html</link>
<description><![CDATA[<p>
Webdesigning me? Nah... Just the old javascript/CSS/XHTML reality check every now and then.
<br /><br />
So here it goes to Leonardo:
<STYLE TYPE="text/css"><!--
.syntax0 {
color: #000000;
}
.syntax1 {
color: #cc0000;
}
.syntax2 {
color: #ff8400;
}
.syntax3 {
color: #6600cc;
}
.syntax4 {
color: #cc6600;
}
.syntax5 {
color: #ff0000;
}
.syntax6 {
color: #9966ff;
}
.syntax7 {
background: #ffffcc;
color: #ff0066;
}
.syntax8 {
color: #006699;
font-weight: bold;
}
.syntax9 {
color: #009966;
font-weight: bold;
}
.syntax10 {
color: #0099ff;
font-weight: bold;
}
.syntax11 {
color: #66ccff;
font-weight: bold;
}
.syntax12 {
color: #02b902;
}
.syntax13 {
color: #ff00cc;
}
.syntax14 {
color: #cc00cc;
}
.syntax15 {
color: #9900cc;
}
.syntax16 {
color: #6600cc;
}
.syntax17 {
color: #0000ff;
}
.syntax18 {
color: #000000;
font-weight: bold;
}
.gutter {
background: #dbdbdb;
color: #000000;
}
.gutterH {
background: #dbdbdb;
color: #990066;
}
-->
</STYLE>
<PRE><SPAN CLASS="gutter">   1:</SPAN><SPAN CLASS="syntax17">&lt;</SPAN><SPAN CLASS="syntax17">html</SPAN><SPAN CLASS="syntax17">&gt;</SPAN>
<SPAN CLASS="gutter">   2:</SPAN><SPAN CLASS="syntax17">&lt;</SPAN><SPAN CLASS="syntax17">head</SPAN><SPAN CLASS="syntax17">&gt;</SPAN>
<SPAN CLASS="gutter">   3:</SPAN><SPAN CLASS="syntax17">&lt;style</SPAN><SPAN CLASS="syntax17">&gt;</SPAN>
<SPAN CLASS="gutter">   4:</SPAN>.body
<SPAN CLASS="gutterH">   5:</SPAN><SPAN CLASS="syntax18">{</SPAN>
<SPAN CLASS="gutter">   6:</SPAN>    <SPAN CLASS="syntax9">font-family</SPAN><SPAN CLASS="syntax18">:</SPAN> verdana;
<SPAN CLASS="gutter">   7:</SPAN>    <SPAN CLASS="syntax9">font-size</SPAN><SPAN CLASS="syntax18">:</SPAN> <SPAN CLASS="syntax5">10pt</SPAN>;
<SPAN CLASS="gutter">   8:</SPAN><SPAN CLASS="syntax18">}</SPAN>
<SPAN CLASS="gutter">   9:</SPAN>
<SPAN CLASS="gutterH">  10:</SPAN>.menuItem, .menuItemHover
<SPAN CLASS="gutter">  11:</SPAN><SPAN CLASS="syntax18">{</SPAN>    
<SPAN CLASS="gutter">  12:</SPAN>    <SPAN CLASS="syntax9">background-color</SPAN><SPAN CLASS="syntax18">:</SPAN> <SPAN CLASS="syntax10">blue</SPAN>;
<SPAN CLASS="gutter">  13:</SPAN>    <SPAN CLASS="syntax9">font-weight</SPAN><SPAN CLASS="syntax18">:</SPAN> <SPAN CLASS="syntax10">bold</SPAN>;
<SPAN CLASS="gutter">  14:</SPAN>    <SPAN CLASS="syntax9">padding</SPAN><SPAN CLASS="syntax18">:</SPAN> <SPAN CLASS="syntax5">5px</SPAN>;
<SPAN CLASS="gutterH">  15:</SPAN>    <SPAN CLASS="syntax9">color</SPAN><SPAN CLASS="syntax18">:</SPAN> <SPAN CLASS="syntax10">white</SPAN>;
<SPAN CLASS="gutter">  16:</SPAN>    <SPAN CLASS="syntax9">display</SPAN><SPAN CLASS="syntax18">:</SPAN> <SPAN CLASS="syntax10">inline</SPAN>;
<SPAN CLASS="gutter">  17:</SPAN>    <SPAN CLASS="syntax9">cursor</SPAN><SPAN CLASS="syntax18">:</SPAN> <SPAN CLASS="syntax10">pointer</SPAN>;
<SPAN CLASS="gutter">  18:</SPAN><SPAN CLASS="syntax18">}</SPAN>
<SPAN CLASS="gutter">  19:</SPAN>
<SPAN CLASS="gutterH">  20:</SPAN>.menuItemHover
<SPAN CLASS="gutter">  21:</SPAN><SPAN CLASS="syntax18">{</SPAN>
<SPAN CLASS="gutter">  22:</SPAN>    <SPAN CLASS="syntax9">background-color</SPAN><SPAN CLASS="syntax18">:</SPAN> <SPAN CLASS="syntax10">lightblue</SPAN>;
<SPAN CLASS="gutter">  23:</SPAN><SPAN CLASS="syntax18">}</SPAN>
<SPAN CLASS="gutter">  24:</SPAN><SPAN CLASS="syntax17">&lt;/style&gt;</SPAN>
<SPAN CLASS="gutterH">  25:</SPAN>
<SPAN CLASS="gutter">  26:</SPAN><SPAN CLASS="syntax17">&lt;script</SPAN><SPAN CLASS="syntax17"> </SPAN><SPAN CLASS="syntax17">language</SPAN><SPAN CLASS="syntax17">=</SPAN><SPAN CLASS="syntax17">&quot;</SPAN><SPAN CLASS="syntax17">javascript</SPAN><SPAN CLASS="syntax17">&quot;</SPAN><SPAN CLASS="syntax17">&gt;</SPAN>
<SPAN CLASS="gutter">  27:</SPAN>document<SPAN CLASS="syntax18">.</SPAN>onmouseover <SPAN CLASS="syntax18">=</SPAN> <SPAN CLASS="syntax8">function</SPAN>(ev)
<SPAN CLASS="gutter">  28:</SPAN><SPAN CLASS="syntax18">{</SPAN>
<SPAN CLASS="gutter">  29:</SPAN>    <SPAN CLASS="syntax8">var</SPAN> element <SPAN CLASS="syntax18">=</SPAN> <SPAN CLASS="syntax6">getEventTarget</SPAN>(ev)<SPAN CLASS="syntax18">;</SPAN>
<SPAN CLASS="gutterH">  30:</SPAN>    <SPAN CLASS="syntax8">if</SPAN> (<SPAN CLASS="syntax13">&quot;</SPAN><SPAN CLASS="syntax13">menuItem</SPAN><SPAN CLASS="syntax13">&quot;</SPAN> <SPAN CLASS="syntax18">=</SPAN><SPAN CLASS="syntax18">=</SPAN> element<SPAN CLASS="syntax18">.</SPAN>className)
<SPAN CLASS="gutter">  31:</SPAN>    <SPAN CLASS="syntax18">{</SPAN>
<SPAN CLASS="gutter">  32:</SPAN>        element<SPAN CLASS="syntax18">.</SPAN>className <SPAN CLASS="syntax18">=</SPAN> <SPAN CLASS="syntax13">&quot;</SPAN><SPAN CLASS="syntax13">menuItemHover</SPAN><SPAN CLASS="syntax13">&quot;</SPAN><SPAN CLASS="syntax18">;</SPAN>
<SPAN CLASS="gutter">  33:</SPAN>    <SPAN CLASS="syntax18">}</SPAN>
<SPAN CLASS="gutter">  34:</SPAN><SPAN CLASS="syntax18">}</SPAN>
<SPAN CLASS="gutterH">  35:</SPAN>
<SPAN CLASS="gutter">  36:</SPAN>document<SPAN CLASS="syntax18">.</SPAN>onmouseout <SPAN CLASS="syntax18">=</SPAN> <SPAN CLASS="syntax8">function</SPAN>(ev)
<SPAN CLASS="gutter">  37:</SPAN><SPAN CLASS="syntax18">{</SPAN>
<SPAN CLASS="gutter">  38:</SPAN>    <SPAN CLASS="syntax8">var</SPAN> element <SPAN CLASS="syntax18">=</SPAN> <SPAN CLASS="syntax6">getEventTarget</SPAN>(ev)<SPAN CLASS="syntax18">;</SPAN>
<SPAN CLASS="gutter">  39:</SPAN>    <SPAN CLASS="syntax8">if</SPAN> (<SPAN CLASS="syntax13">&quot;</SPAN><SPAN CLASS="syntax13">menuItemHover</SPAN><SPAN CLASS="syntax13">&quot;</SPAN> <SPAN CLASS="syntax18">=</SPAN><SPAN CLASS="syntax18">=</SPAN> element<SPAN CLASS="syntax18">.</SPAN>className)
<SPAN CLASS="gutterH">  40:</SPAN>    <SPAN CLASS="syntax18">{</SPAN>
<SPAN CLASS="gutter">  41:</SPAN>        element<SPAN CLASS="syntax18">.</SPAN>className <SPAN CLASS="syntax18">=</SPAN> <SPAN CLASS="syntax13">&quot;</SPAN><SPAN CLASS="syntax13">menuItem</SPAN><SPAN CLASS="syntax13">&quot;</SPAN><SPAN CLASS="syntax18">;</SPAN>
<SPAN CLASS="gutter">  42:</SPAN>    <SPAN CLASS="syntax18">}</SPAN>
<SPAN CLASS="gutter">  43:</SPAN><SPAN CLASS="syntax18">}</SPAN>
<SPAN CLASS="gutter">  44:</SPAN>
<SPAN CLASS="gutterH">  45:</SPAN><SPAN CLASS="syntax8">function</SPAN> <SPAN CLASS="syntax6">getEventTarget</SPAN>(ev)
<SPAN CLASS="gutter">  46:</SPAN><SPAN CLASS="syntax18">{</SPAN>
<SPAN CLASS="gutter">  47:</SPAN>    <SPAN CLASS="syntax8">return</SPAN> (ev <SPAN CLASS="syntax18">&amp;</SPAN><SPAN CLASS="syntax18">&amp;</SPAN> ev<SPAN CLASS="syntax18">.</SPAN>target) <SPAN CLASS="syntax18">|</SPAN><SPAN CLASS="syntax18">|</SPAN> window<SPAN CLASS="syntax18">.</SPAN>event<SPAN CLASS="syntax18">.</SPAN>srcElement<SPAN CLASS="syntax18">;</SPAN>
<SPAN CLASS="gutter">  48:</SPAN><SPAN CLASS="syntax18">}</SPAN>
<SPAN CLASS="gutter">  49:</SPAN>
<SPAN CLASS="gutterH">  50:</SPAN><SPAN CLASS="syntax17">&lt;/script&gt;</SPAN>
<SPAN CLASS="gutter">  51:</SPAN><SPAN CLASS="syntax17">&lt;</SPAN><SPAN CLASS="syntax17">/</SPAN><SPAN CLASS="syntax17">head</SPAN><SPAN CLASS="syntax17">&gt;</SPAN>
<SPAN CLASS="gutter">  52:</SPAN><SPAN CLASS="syntax17">&lt;</SPAN><SPAN CLASS="syntax17">body</SPAN><SPAN CLASS="syntax17">&gt;</SPAN>
<SPAN CLASS="gutter">  53:</SPAN>
<SPAN CLASS="gutter">  54:</SPAN><SPAN CLASS="syntax17">&lt;</SPAN><SPAN CLASS="syntax17">div</SPAN><SPAN CLASS="syntax17"> </SPAN><SPAN CLASS="syntax17">id</SPAN><SPAN CLASS="syntax18">=</SPAN><SPAN CLASS="syntax13">&quot;</SPAN><SPAN CLASS="syntax13">menuBar</SPAN><SPAN CLASS="syntax13">&quot;</SPAN><SPAN CLASS="syntax17">&gt;</SPAN>
<SPAN CLASS="gutterH">  55:</SPAN><SPAN CLASS="syntax17">&lt;</SPAN><SPAN CLASS="syntax17">div</SPAN><SPAN CLASS="syntax17"> </SPAN><SPAN CLASS="syntax17">class</SPAN><SPAN CLASS="syntax18">=</SPAN><SPAN CLASS="syntax13">&quot;</SPAN><SPAN CLASS="syntax13">menuItem</SPAN><SPAN CLASS="syntax13">&quot;</SPAN><SPAN CLASS="syntax17">&gt;</SPAN>
<SPAN CLASS="gutter">  56:</SPAN><SPAN CLASS="syntax17">&lt;</SPAN><SPAN CLASS="syntax17">img</SPAN><SPAN CLASS="syntax17"> </SPAN><SPAN CLASS="syntax17">src</SPAN><SPAN CLASS="syntax18">=</SPAN><SPAN CLASS="syntax13">&quot;</SPAN><SPAN CLASS="syntax13">images/arrow.gif</SPAN><SPAN CLASS="syntax13">&quot;</SPAN><SPAN CLASS="syntax17"> </SPAN><SPAN CLASS="syntax17">/</SPAN><SPAN CLASS="syntax17">&gt;</SPAN>
<SPAN CLASS="gutter">  57:</SPAN>About US
<SPAN CLASS="gutter">  58:</SPAN><SPAN CLASS="syntax17">&lt;</SPAN><SPAN CLASS="syntax17">/</SPAN><SPAN CLASS="syntax17">div</SPAN><SPAN CLASS="syntax17">&gt;</SPAN>
<SPAN CLASS="gutter">  59:</SPAN><SPAN CLASS="syntax17">&lt;</SPAN><SPAN CLASS="syntax17">div</SPAN><SPAN CLASS="syntax17"> </SPAN><SPAN CLASS="syntax17">class</SPAN><SPAN CLASS="syntax18">=</SPAN><SPAN CLASS="syntax13">&quot;</SPAN><SPAN CLASS="syntax13">menuItem</SPAN><SPAN CLASS="syntax13">&quot;</SPAN><SPAN CLASS="syntax17">&gt;</SPAN>
<SPAN CLASS="gutterH">  60:</SPAN><SPAN CLASS="syntax17">&lt;</SPAN><SPAN CLASS="syntax17">img</SPAN><SPAN CLASS="syntax17"> </SPAN><SPAN CLASS="syntax17">src</SPAN><SPAN CLASS="syntax18">=</SPAN><SPAN CLASS="syntax13">&quot;</SPAN><SPAN CLASS="syntax13">images/arrow.gif</SPAN><SPAN CLASS="syntax13">&quot;</SPAN><SPAN CLASS="syntax17"> </SPAN><SPAN CLASS="syntax17">/</SPAN><SPAN CLASS="syntax17">&gt;</SPAN>
<SPAN CLASS="gutter">  61:</SPAN>Products
<SPAN CLASS="gutter">  62:</SPAN><SPAN CLASS="syntax17">&lt;</SPAN><SPAN CLASS="syntax17">/</SPAN><SPAN CLASS="syntax17">div</SPAN><SPAN CLASS="syntax17">&gt;</SPAN>
<SPAN CLASS="gutter">  63:</SPAN><SPAN CLASS="syntax17">&lt;</SPAN><SPAN CLASS="syntax17">/</SPAN><SPAN CLASS="syntax17">div</SPAN><SPAN CLASS="syntax17">&gt;</SPAN>
<SPAN CLASS="gutter">  64:</SPAN>
<SPAN CLASS="gutterH">  65:</SPAN>
<SPAN CLASS="gutter">  66:</SPAN><SPAN CLASS="syntax17">&lt;</SPAN><SPAN CLASS="syntax17">/</SPAN><SPAN CLASS="syntax17">body</SPAN><SPAN CLASS="syntax17">&gt;</SPAN>
<SPAN CLASS="gutter">  67:</SPAN><SPAN CLASS="syntax17">&lt;</SPAN><SPAN CLASS="syntax17">/</SPAN><SPAN CLASS="syntax17">html</SPAN><SPAN CLASS="syntax17">&gt;</SPAN>
</PRE>
<br /><br />
The same old few conclusions:
<ul>
<li>CSS has really nice features, how can be people not using it more?</li>
<li>tableless html is easier to read, easier to write, easier to change  (at least if you are using jedit such as myself)</li>
<li>tableless html is easier to relayout (think skins)</li>
</ul>
 so again, why do we still have deeply nested tables everywhere? Dreamweaver?
</p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-10-05T17:39:43-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000848_generator_methods_looking_good.html">
<title>generator methods... looking good!</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000848_generator_methods_looking_good.html</link>
<description><![CDATA[<p>
Tough weekend but I've finally got generator methods to work.
<br /><br />
Integrating generator methods with generator expressions with closures was a good challenge... Next! :)
<br /><br />
And before I go I shall leave you with this amazing piece of cra... hmm... code:
<PRE><CODE>
b <FONT COLOR="#000000"><STRONG>=</STRONG></FONT> <FONT COLOR="#ff0000">5</FONT>
g <FONT COLOR="#000000"><STRONG>=</STRONG></FONT> <FONT COLOR="#006699"><STRONG>def</STRONG></FONT> <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> <FONT COLOR="#ff0000">0</FONT>
    <FONT COLOR="#006699"><STRONG>yield</STRONG></FONT> <FONT COLOR="#000000"><STRONG>{</STRONG></FONT> <FONT COLOR="#006699"><STRONG>return</STRONG></FONT> a <FONT COLOR="#000000"><STRONG>}</STRONG></FONT>
    <FONT COLOR="#006699"><STRONG>yield</STRONG></FONT> <FONT COLOR="#000000"><STRONG>{</STRONG></FONT> <FONT COLOR="#006699"><STRONG>return</STRONG></FONT> <FONT COLOR="#000000"><STRONG>++</STRONG></FONT>a <FONT COLOR="#000000"><STRONG>}</STRONG></FONT>
    <FONT COLOR="#006699"><STRONG>yield</STRONG></FONT> <FONT COLOR="#000000"><STRONG>{</STRONG></FONT> a <FONT COLOR="#000000"><STRONG>=</STRONG></FONT> b; <FONT COLOR="#006699"><STRONG>return</STRONG></FONT> <FONT COLOR="#000000"><STRONG>{</STRONG></FONT> <FONT COLOR="#006699"><STRONG>return</STRONG></FONT> <FONT COLOR="#000000"><STRONG>(</STRONG></FONT>a<FONT COLOR="#000000"><STRONG>+</STRONG></FONT>b<FONT COLOR="#000000"><STRONG>)</STRONG></FONT><FONT COLOR="#000000"><STRONG>*</STRONG></FONT>i <FONT COLOR="#006699"><STRONG>for</STRONG></FONT> i <FONT COLOR="#006699"><STRONG>in</STRONG></FONT> range<FONT COLOR="#000000"><STRONG>(</STRONG></FONT><FONT COLOR="#ff0000">3</FONT><FONT COLOR="#000000"><STRONG>)</STRONG></FONT> <FONT COLOR="#000000"><STRONG>}</STRONG></FONT> <FONT COLOR="#000000"><STRONG>}</STRONG></FONT>
    <FONT COLOR="#0099ff"><STRONG>assert</STRONG></FONT> <FONT COLOR="#ff0000">5</FONT> <FONT COLOR="#000000"><STRONG>=</STRONG></FONT><FONT COLOR="#000000"><STRONG>=</STRONG></FONT> a
    
    
<FONT COLOR="#006699"><STRONG>for</STRONG></FONT> f <FONT COLOR="#006699"><STRONG>in</STRONG></FONT> g<FONT COLOR="#000000"><STRONG>(</STRONG></FONT><FONT COLOR="#000000"><STRONG>)</STRONG></FONT><FONT COLOR="#000000"><STRONG>:</STRONG></FONT>
    item <FONT COLOR="#000000"><STRONG>=</STRONG></FONT> f<FONT COLOR="#000000"><STRONG>(</STRONG></FONT><FONT COLOR="#000000"><STRONG>)</STRONG></FONT>  
    <FONT COLOR="#006699"><STRONG>if</STRONG></FONT> item <FONT COLOR="#006699"><STRONG>isa</STRONG></FONT> <FONT COLOR="#006699"><STRONG>callable</STRONG></FONT><FONT COLOR="#000000"><STRONG>:</STRONG></FONT>
        b <FONT COLOR="#000000"><STRONG>=</STRONG></FONT> <FONT COLOR="#ff0000">3</FONT>
        <FONT COLOR="#0099ff"><STRONG>print</STRONG></FONT><FONT COLOR="#000000"><STRONG>(</STRONG></FONT><FONT COLOR="#0099ff"><STRONG>join</STRONG></FONT><FONT COLOR="#000000"><STRONG>(</STRONG></FONT><FONT COLOR="#006699"><STRONG>cast</STRONG></FONT><FONT COLOR="#000000"><STRONG>(</STRONG></FONT><FONT COLOR="#006699"><STRONG>callable</STRONG></FONT>, item<FONT COLOR="#000000"><STRONG>)</STRONG></FONT><FONT COLOR="#000000"><STRONG>(</STRONG></FONT><FONT COLOR="#000000"><STRONG>)</STRONG></FONT>, <FONT COLOR="#ff00cc">&quot;</FONT><FONT COLOR="#ff00cc">,</FONT><FONT COLOR="#ff00cc"> </FONT><FONT COLOR="#ff00cc">&quot;</FONT><FONT COLOR="#000000"><STRONG>)</STRONG></FONT><FONT COLOR="#000000"><STRONG>)</STRONG></FONT>
    <FONT COLOR="#006699"><STRONG>else</STRONG></FONT><FONT COLOR="#000000"><STRONG>:</STRONG></FONT>
        <FONT COLOR="#0099ff"><STRONG>print</STRONG></FONT><FONT COLOR="#000000"><STRONG>(</STRONG></FONT>item<FONT COLOR="#000000"><STRONG>)</STRONG></FONT>
</CODE></PRE>which prints:
<pre>
0
1
0, 8, 16
</pre>
Understand why and you'll understand boo's main features.
</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-10-05T17:24:58-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000847_for_the_cat_lovers_out_there.html">
<title>For the cat lovers out there</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000847_for_the_cat_lovers_out_there.html</link>
<description><![CDATA[<p><a href="http://www.infinitecat.com/">The Infinite Cat Project</a>.</p>

<p>I'm still deciding on which of my cats will go first...</p>]]></description>
<dc:subject>life</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-10-05T17:12:10-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000843_type_inference_in_boo.html">
<title>Type inference in boo</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000843_type_inference_in_boo.html</link>
<description><![CDATA[<p>I've finally set some time aside to write about <a href="http://boo.codehaus.org/Type+Inference">boo's type inference mechanism</a>.</p>

<p>Comments (here or in confluence) are welcome.</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-09-30T11:18:56-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000841_vote_against_bush.html">
<title>Vote against Bush</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000841_vote_against_bush.html</link>
<description><![CDATA[<p>Hey you! Yeah, you, the ones deciding the fate of the empire during the next few days. </p>

<p>Have in mind that whatever you decide will have a huge impact on the life of everyone else on this planet (and maybe the universe, how greedy can those in power become?) so please <b>vote against Bush!</b></p>

<p>And if you haven't made up your mind yet or were thinking on not voting just because everyone sucks, please, be the voice of those without one and <b>vote against Bush</b>!</p>

<p>Please?</p>]]></description>
<dc:subject>life</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-09-29T10:31:07-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000836_boo_04_is_out.html">
<title>boo 0.4 is out</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000836_boo_04_is_out.html</link>
<description><![CDATA[<p>Grab yours <a href="http://boo.codehaus.org/Download">here</a>!<p>
<p>Tons of improvements in this version, true closures are my favorite one since they allow ruby-like things such as:
<pre><code>def each(items, closure as callable):
    for item in items:
         closure(item)

items = [1, 2, 3, 4, 5]
value = 0
each(items) do (item as int):
     value += item
print(value)

</code>
</pre>

In this example the closure is constructed with the do keyword and is automagically passed as the last argument to the each function. Cool or what?
</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-09-14T16:49:10-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000834_holy_circumflexes.html">
<title>Holy circumflexes!</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000834_holy_circumflexes.html</link>
<description><![CDATA[<p>
What ever happened to <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/stl-netprimer.asp">C++</a>?
</p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-09-10T22:41:06-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000830_monogetoptions_rules.html">
<title>Mono.GetOptions rules</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000830_monogetoptions_rules.html</link>
<description><![CDATA[<p>
I had to create a little (because boo code tends to be terse) console utility for a customer. The utility had to deal with lots of different command line options, that kind of thing. So I saw it as my opportunity to finally meet Mono.GetOptions.
<br />
What a nice tool!
<br />
<code><pre>
import Mono.GetOptions from Mono.GetOptions

class CommandLineOptions(Options):

    def constructor(argv):
        ProcessArgs(argv)

    [Option("thumbnail width", "width")]
    public Width = 70

    [Option("thumbnail height", "height")]
    public Height = 70

    [Option("output file", "output")]
    public OutputFileName = ""

    [Option("input file", "input")]
    public InputFileName = ""

    [Option("encoding quality level (1-100), default is 75",  "encoding-quality")]
    public EncodingQuality = 75L

    IsValid as bool:
        get:
            return (0 == len(RemainingArguments) and
                        len(OutputFileName) > 0 and
                        len(InputFileName) > 0 and
                        Width > 0 and
                        Height > 0)

options = CommandLineOptions(argv)
if options.IsValid:	
    for field in typeof(CommandLineOptions).GetFields():
        print("${field.Name}: ${field.GetValue(options)}")
else:
    options.DoHelp()
</pre>
</code>

Fire this script with <pre>booi GetOptions.boo</pre> and you'll already see a pretty professional looking help.
<br />
My heart would be filled of joy every time I needed to add support for a new parameter :)
<br /><br />
Very nice work Rafael!
</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-09-03T18:29:14-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000825_the_dark_side_of_the_moon_and_the_wizard_of_oz.html">
<title>The Dark Side of The Moon and The Wizard of OZ</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000825_the_dark_side_of_the_moon_and_the_wizard_of_oz.html</link>
<description><![CDATA[<p>Simply <b>amazing</b>!</p>
<p>Just watch and check the coincidences for yourself. It's quite a trip.</p>]]></description>
<dc:subject>culture</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-08-31T09:52:36-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000823_setting_propertiesfieldsevents_at_constructtime.html">
<title>Setting properties/fields/events at construct-time</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000823_setting_propertiesfieldsevents_at_constructtime.html</link>
<description><![CDATA[<p>Edd Dumbill talks about one of the <a href="http://ironpython.org">IronPython</a> niceties <a href="http://usefulinc.com/edd/blog/contents/2004/08/29-ironpy/read">here</a>.
<br />
<br />
boo also allows it and it works not only with properties but with events and fields too:
<code><pre>
import System

class Button:

    [property(Text)]
    _text = ""

    public Width = 0

    event Click as EventHandler
	
    def RaiseClick():
        self.Click(self, EventArgs.Empty)

b = Button(Text: "Click me", Width: 10, Click: <print("clicked!")>)
print(b.Text)
print(b.Width)
b.RaiseClick()
</pre>
</code>

<br />
Cool or what?
</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-08-30T09:05:59-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000814_back_to_the_notebook.html">
<title>Back to the notebook</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000814_back_to_the_notebook.html</link>
<description><![CDATA[It's been some time now since my notebook
(as in "A light, portable computer that is generally thinner than a laptop") went
to the repair shop and I feel extremely free.<br />
<br />
I've been spending much more time with my family and friends (
including my books, comics and CDs). I still haven't got back to playing the drums
but I'm sure I will... eventually.<br />
<br />
Cutting straight to the chase I decided to finally work on issue 
<a href="http://jira.codehaus.org/browse/BOO-17">BOO-17 (automatic callable type conversion and adaptation)
</a> so I grabbed my notebook (as in "A book of blank pages for notes") and programmed
away. Programming on paper can be so much easier sometimes! A simple solution was already there
just waiting for me to uncover it.
<br /><br />
The problem I was trying to solve was twofold: first, 
delegate types (callables) are name equivalent not structurally equivalent in the
CLI type system, in other words, the following valid boo code can not be directly translated
to IL for being deemed unverifiable:<br />
<code><pre>
callable Function()

def foo():
   pass
   
# the following line silently generates a
# new (anonymous) callable type structurally
# equivalent to the declared callable Function1
# above
a = foo

fn as Function
fn = a
fn()
</pre>
</code>

Second, boo compatibility rules for callable references go beyond simple
structural equivalence, a RVALUE callable reference can be assigned to any
LVALUE reference if any of the following conditions is true:
<ul>
<li>their types are the same (name equivalence)</li>
<li>their types are structurally equivalent (same number of arguments, arguments all of the same type,
same return type)</li>
<li>the callable on the right takes the same number of arguments or less and
all of them are assignment compatible with the arguments of the callable on the left</li>
</ul>
Example:
<code><pre>
import System

def click1():
    print("clicked!")
	
def click2(sender):
	print("${sender} clicked!")
	
def click3(sender as string):
	print("${sender} clicked!")
	
handler as EventHandler

handler = click1
handler(null, EventArgs.Empty)

handler = click2
handler("foo", EventArgs.Empty)

handler = click3
handler("bar", EventArgs.Empty)
</pre>
</code>

<h3>The Solution</h3>
It's actually pretty simple and it works for both cases: get the compiler to
generate an adaptor class containing:
<ul>
<ol>a single argument constructor taking the RVALUE reference</ol>
<ol>a method strictly compatible with the LVALUE reference</ol>
<ol>a factory method that will take the RVALUE reference and return a LVALUE
compatible reference</ol>
</ul>
The only thing left to do is to replace the RVALUE reference by the factory method
invocation. Making it all more concrete, the compiler must transform code like
this:
<code><pre>
callable Function()

def click():
    print("clicked!")
	
fn as Function = click

handler as EventHandler = fn
</pre>
</code>

Into something like this:
<code><pre>
callable Function()

class __Adaptor0__:

    __callable__ as Function

    def constructor(value as Function):
        self.__callable__ = value

    def Invoke(sender as object, args as System.EventArgs) as void:
        self.__callable__()

    static def Adapt(value as Function) as System.EventHandler:
        adapted = __Adaptor0__(value)
        return adapted.Invoke

def click():
    print("clicked!")

fn as Function = click
handler as EventHandler = __Adaptor0__.Adapt(fn)
</pre>
</code>

Unfortunately my current notebook can't run unit tests yet :)]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-08-09T13:45:08-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000813_its_way_past_time_to_fix_it.html">
<title>It’s way past time to fix it</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000813_its_way_past_time_to_fix_it.html</link>
<description><![CDATA[Nice essay on <a href="http://tbray.org/ongoing/When/200x/2004/08/05/LinuxPatents">Patents and Linux</a>.<br />
And just in case you are wondering I totally agree.]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-08-09T11:35:53-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000808_weapons_of_mass_destruction.html">
<title>Weapons of mass destruction</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000808_weapons_of_mass_destruction.html</link>
<description><![CDATA[<p>
I've finally had the chance to watch <a href="http://www.fahrenheit911.com/about/">Fahrenheit 9/11</a> last night. One of the funniest pieces I've seen in a long time.<br />
The americans on the line behind us didn't seem to understand why I laughed all the way through.<br>
Homer Simpson puts it best: "It's funny because it's true!".
</p>]]></description>
<dc:subject>culture</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-08-05T15:28:50-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000805_sun_ship.html">
<title>Sun Ship</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000805_sun_ship.html</link>
<description><![CDATA[<p>I have never heard anything like that.</p>
<p>The <a href="http://www.vervemusicgroup.com/product.aspx?ob=prd&src=list&pid=9530"> Sun Ship</a> of John Coltrane, Elvin Jones, McCoy Tyner and Jimmy Garrision took me far far away to the deepest and darkest corners of the universe.</p>
<p>Ohm.</p>
<p>An even flow of love that irradiates from the very essence of the existence. </p>]]></description>
<dc:subject>culture</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-07-30T21:51:01-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000804_ironpython.html">
<title>IronPython</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000804_ironpython.html</link>
<description><![CDATA[<p>
The 0.6 version of <a href="http://ironpython.com/">IronPython</a> was just released. I still don't know how to feel about Jim being hired by MS though.
</p>
<p>
Anyway, I've just played a little with it and it looks great! 
</p>
<p>
The distro comes with a System.Windows.Forms example that I decided to translate to boo just for the fun of it:
<pre>
<code>import System.Windows.Forms from System.Windows.Forms
import System.Drawing from System.Drawing

f = Form(Text:"Windows fun with boo",
         HelpButton: true,
         MinimizeBox: false,
		 MaximizeBox: false,
		 FormBorderStyle: FormBorderStyle.FixedDialog,
		 StartPosition: FormStartPosition.CenterScreen)		 

b1 = Button(Text:"Say Something", Location:Point(30,30), Size:Size(100,30))
b1.Click += callable:
    l = Label(Text:"boo is Alive!", ForeColor:Color.Red)
    l.Location = Point(30, 50+f.Controls.Count*25)
    f.Controls.Add(l)

f.Controls.Add(b1)
f.ShowDialog()

</code>

</pre>
</p>
<p>
The future seems brighter on .net land.
</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-07-29T12:48:36-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000803_great_hackers.html">
<title>Great hackers</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000803_great_hackers.html</link>
<description><![CDATA[<p>
If you haven't read it yet here's <a href="http://www.paulgraham.com/gh.html">another great essay by Paul Graham</a>.
</p>
<p>
Graham says:
<blockquote>
The programmers you'll be able to hire to work on a Java project won't be as smart as the ones you could get to work on a project written in Python.
</blockquote>
</p>
<p>s/Python/boo/ and it is still true! :)</p>]]></description>
<dc:subject>technology</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-07-29T11:52:29-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000798_writing_tests_for_boo.html">
<title>Writing tests for boo</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000798_writing_tests_for_boo.html</link>
<description><![CDATA[<p>Soooo... I've decided to spend most of my free time this weekend polishing the way test cases for <a href="http://boo.codehaus.org/">boo</a> are written. Hopefully I made it <a href="http://boo.codehaus.org/Writing+Tests">so easy</a> that new feature requests and bug reports will already come with lots of attached test cases.</p>

<p>Thoughts/comments/suggestions/criticisms? Let me know.</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-07-26T02:20:24-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000795_when_i_was_29.html">
<title>When I was 29</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000795_when_i_was_29.html</link>
<description><![CDATA[<p>The guys had a surprise for me today:</p>

<p><img src="http://www.codehaus.org/~bamboo/equipe.jpg" /><br />
<font size="-1">From left to right: Leo, Andre, me and Carlos</font></p>

<p>Oh, guys! I hate you so much. :)</p>]]></description>
<dc:subject>life</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-07-21T18:38:03-03:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/bamboo/archives/000791_boo_explorer_for_linux.html">
<title>Boo Explorer for linux</title>
<link>http://blogs.codehaus.org/people/bamboo/archives/000791_boo_explorer_for_linux.html</link>
<description><![CDATA[<p>
boo users on windows can already count on a simple but very effective way to edit and run their boo scripts: <a href="http://boo.codehaus.org/Boo+Explorer">boox</a>. boox even features code completion! (You're the man, GB!).
</p>
<p>
The somewhat bad news (at least for me) is that I'm no longer a happy boox user since my notebook went to the repair shop two weeks ago.
</p>
<p>
The good news is that now I got a real chance and the motivation to create a similar tool for my fellow linux users. I hope to finally learn some gtk programming techniques along the way.
</p>
<p>
So here's my first shot at creating Boo Explorer for linux: a dumb GtkSourceView based editor with boo syntax highlighting enabled.
</p>
<pre>
import System
import Gtk from "gtk-sharp"
import GtkSourceView from "gtksourceview-sharp"

def window_Delete(sender, args as DeleteEventArgs):
   Application.Quit()
   args.RetVal = true

Application.Init()	
booSourceLanguage = SourceLanguagesManager().GetLanguageFromMimeType("text/x-boo")
buffer = SourceBuffer(booSourceLanguage, Highlight: true)	
sourceView = SourceView(buffer, ShowLineNumbers: true, AutoIndent: true)
window = Window("Simple Boo Editor",
                           DefaultWidth:  600,
                           DefaultHeight: 400,
                           DeleteEvent: window_Delete)
window.Add(sourceView)
window.ShowAll()
Application.Run()
</pre>
<p>
Now I just need to learn how to add a menubar, a toolbar, a statusbar, a tree view (document outline), how to handle accelerator keys then I'm pretty much set :-)
</p>]]></description>
<dc:subject>boo</dc:subject>
<dc:creator>bamboo</dc:creator>
<dc:date>2004-07-17T14:52:23-03:00</dc:date>
</item>


</rdf:RDF>
