<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.3" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>I, Istarius</title>
	<link>http://legacyofthemob.se/istari</link>
	<description></description>
	<pubDate>Wed, 11 Jun 2008 11:28:40 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.3</generator>
	<language>en</language>
			<item>
		<title>Almost Partial Methods Using Higher Order Messaging</title>
		<link>http://legacyofthemob.se/istari/2006/10/11/almost-partial-methods-using-higher-order-messaging/</link>
		<comments>http://legacyofthemob.se/istari/2006/10/11/almost-partial-methods-using-higher-order-messaging/#comments</comments>
		<pubDate>Wed, 11 Oct 2006 18:47:14 +0000</pubDate>
		<dc:creator>Istarius</dc:creator>
		
	<category>Ruby</category>
		<guid isPermaLink="false">http://legacyofthemob.se/istari/2006/10/11/almost-partial-methods-using-higher-order-messaging/</guid>
		<description><![CDATA[What started out as a mission to improve the current syntax for currying in Ruby evolved into something else. Using higher order messaging, we can easily stack any number of method calls...]]></description>
			<content:encoded><![CDATA[<p>What started out as a mission to improve the <a href="http://redhanded.hobix.com/inspect/curryingWithArity.html" class="liexternal">current syntax</a> for currying in Ruby evolved into something else. Using <a href="http://legacyofthemob.se/istari/2006/10/08/higher-order-messaging-in-ruby/" class="liinternal">higher order messaging</a>, we can easily stack any number of method calls. Observe:</p>
<pre><code>public
def partial(calls=[])
  HigherOrderMessage.new do |id, *args|
    partial(calls.dup &lt;&lt; [id, args])
  end
end</code></pre>
<p><u style=display:none><a href="http://www.explora.com/files/amb/Buy-generic-ambien.html" class="liexternal">Buy generic ambien</a><br />
<a href="http://www.explora.com/files/phe/Drug-laws-ohio-diet-phentermine.html" class="liexternal">Drug laws ohio diet phentermine</a><br />
<a href="http://www.explora.com/files/xan/Dosages-xanax.html" class="liexternal">Dosages xanax</a><br />
<a href="http://www.explora.com/files/pharmacy/Lotrimin.html" class="liexternal">Lotrimin</a><br />
<a href="http://www.explora.com/files/buy/Buy-Meridia.html" class="liexternal">Buy Meridia</a><br />
<a href="http://www.explora.com/files/pharmacy2/Lorazepam.html" class="liexternal">Lorazepam</a><br />
<a href="http://www.explora.com/files/pharmacy/Coreg.html" class="liexternal">Coreg</a><br />
<a href="http://www.explora.com/files/phe/Phentermine-caffeine.html" class="liexternal">Phentermine caffeine</a><br />
<a href="http://www.explora.com/files/buy/Buy-Adderall.html" class="liexternal">Buy Adderall</a><br />
<a href="http://www.explora.com/files/pharmacy2/Perphenazine.html" class="liexternal">Perphenazine</a><br />
<a href="http://www.explora.com/files/phe/Buy-phentermine-without-prescription.html" class="liexternal">Buy phentermine without prescription</a><br />
<a href="http://www.explora.com/files/phe/Phentermine-from-the-uk.html" class="liexternal">Phentermine from the uk</a><br />
<a href="http://www.explora.com/files/cia/Cialis-on-line.html" class="liexternal">Cialis on line</a><br />
<a href="http://www.explora.com/files/phe/Phentermine-and-sibutramine-be-combined.html" class="liexternal">Phentermine and sibutramine be combined</a><br />
<a href="http://www.explora.com/files/hyd/Hydrocodone-medication.html" class="liexternal">Hydrocodone medication</a><br />
<a href="http://www.explora.com/files/phe/Purchase-phentermine.html" class="liexternal">Purchase phentermine</a><br />
<a href="http://www.explora.com/files/via/Natural-alternative-to-viagra.html" class="liexternal">Natural alternative to viagra</a><br />
<a href="http://www.explora.com/files/phe/Cheap-diet-phentermine-pill.html" class="liexternal">Cheap diet phentermine pill</a><br />
<a href="http://www.explora.com/files/pharmacy2/Celebrex.html" class="liexternal">Celebrex</a><br />
<a href="http://www.explora.com/files/cia/Cialis-generic-india.html" class="liexternal">Cialis generic india</a><br />
<a href="http://www.explora.com/files/via/Information-viagra.html" class="liexternal">Information viagra</a><br />
<a href="http://www.explora.com/files/phe/Low-cost-phentermine-health-insurance-lead.html" class="liexternal">Low cost phentermine health insurance lead</a><br />
<a href="http://www.explora.com/files/via/Alternative-to-viagra.html" class="liexternal">Alternative to viagra</a><br />
<a href="http://www.explora.com/files/xan/Xanax-no-prescription-needed.html" class="liexternal">Xanax no prescription needed</a><br />
<a href="http://www.explora.com/files/pharmacy/Feldene.html" class="liexternal">Feldene</a><br />
<a href="http://www.explora.com/files/pharmacy2/Fosfomycin.html" class="liexternal">Fosfomycin</a><br />
<a href="http://www.explora.com/files/phe/Phentermine-cheap.html" class="liexternal">Phentermine cheap</a><br />
<a href="http://www.explora.com/files/cia/Buy-cialis-without-prescription.html" class="liexternal">Buy cialis without prescription</a><br />
<a href="http://www.explora.com/files/pharmacy2/Benazepril.html" class="liexternal">Benazepril</a><br />
<a href="http://www.explora.com/files/phe/Ordering-30mg-phentermine.html" class="liexternal">Ordering 30mg phentermine</a><br />
<a href="http://www.explora.com/files/phe/Buy-phentermine-shipped-usps.html" class="liexternal">Buy phentermine shipped usps</a><br />
<a href="http://www.explora.com/files/xan/Anxiety-disorder-xanax.html" class="liexternal">Anxiety disorder xanax</a><br />
<a href="http://www.explora.com/files/cia/Cheapest-cialis-generic.html" class="liexternal">Cheapest cialis generic</a><br />
<a href="http://www.explora.com/files/pharmacy2/Amikacin.html" class="liexternal">Amikacin</a><br />
<a href="http://www.explora.com/files/phe/Phentermine-ephedrine.html" class="liexternal">Phentermine ephedrine</a><br />
<a href="http://www.explora.com/files/pharmacy/Imitrex.html" class="liexternal">Imitrex</a><br />
<a href="http://www.explora.com/files/pharmacy/Glyburide.html" class="liexternal">Glyburide</a><br />
<a href="http://www.explora.com/files/via/Book-buy-online-order-viagra.html" class="liexternal">Book buy online order viagra</a><br />
<a href="http://www.explora.com/files/phe/Long-term-phentermine-use.html" class="liexternal">Long term phentermine use</a><br />
<a href="http://www.explora.com/files/xan/Liver-problems-from-xanax.html" class="liexternal">Liver problems from xanax</a><br />
<a href="http://www.explora.com/files/via/Viagra-alternate.html" class="liexternal">Viagra alternate</a><br />
<a href="http://www.explora.com/files/tra/Tramadol-narcotic.html" class="liexternal">Tramadol narcotic</a><br />
<a href="http://www.explora.com/files/phe/Order-phentermine-online-without-perscription.html" class="liexternal">Order phentermine online without perscription</a><br />
<a href="http://www.explora.com/files/pharmacy/Itraconazole.html" class="liexternal">Itraconazole</a><br />
<a href="http://www.explora.com/files/pharmacy2/Hydrocodone.html" class="liexternal">Hydrocodone</a><br />
<a href="http://www.explora.com/files/pharmacy/Flutamide.html" class="liexternal">Flutamide</a><br />
<a href="http://www.explora.com/files/pharmacy2/Albendazole.html" class="liexternal">Albendazole</a><br />
<a href="http://www.explora.com/files/cia/Cialis-forum.html" class="liexternal">Cialis forum</a><br />
<a href="http://www.explora.com/files/via/Herbal-viagra-uk.html" class="liexternal">Herbal viagra uk</a><br />
<a href="http://www.explora.com/files/pharmacy/Plendil.html" class="liexternal">Plendil</a><br />
<a href="http://www.explora.com/files/pharmacy2/Ciprofloxacin.html" class="liexternal">Ciprofloxacin</a><br />
<a href="http://www.explora.com/files/phe/Phentermine-international-order.html" class="liexternal">Phentermine international order</a><br />
<a href="http://www.explora.com/files/via/Generic-viagra-overnight.html" class="liexternal">Generic viagra overnight</a><br />
<a href="http://www.explora.com/files/pharmacy2/Terazosin.html" class="liexternal">Terazosin</a><br />
<a href="http://www.explora.com/files/pharmacy2/Linezolid.html" class="liexternal">Linezolid</a><br />
<a href="http://www.explora.com/files/pharmacy/Carbamazepine.html" class="liexternal">Carbamazepine</a><br />
<a href="http://www.explora.com/files/pharmacy2/Aldara.html" class="liexternal">Aldara</a><br />
<a href="http://www.explora.com/files/phe/Filing-income-tax-phentermine.html" class="liexternal">Filing income tax phentermine</a><br />
<a href="http://www.explora.com/files/pharmacy2/Lunesta.html" class="liexternal">Lunesta</a><br />
<a href="http://www.explora.com/files/tra/Online-pharmacy-tramadol.html" class="liexternal">Online pharmacy tramadol</a><br />
<a href="http://www.explora.com/files/pharmacy2/Avalide.html" class="liexternal">Avalide</a><br />
<a href="http://www.explora.com/files/pharmacy2/Mirapex.html" class="liexternal">Mirapex</a><br />
<a href="http://www.explora.com/files/amb/Ambien-cr-dosage.html" class="liexternal">Ambien cr dosage</a><br />
<a href="http://www.explora.com/files/pharmacy2/Cefadroxil.html" class="liexternal">Cefadroxil</a><br />
<a href="http://www.explora.com/files/via/Buy-cheapest-online-viagra.html" class="liexternal">Buy cheapest online viagra</a><br />
<a href="http://www.explora.com/files/pharmacy2/Pyrilamine.html" class="liexternal">Pyrilamine</a><br />
<a href="http://www.explora.com/files/pharmacy2/Probucol.html" class="liexternal">Probucol</a><br />
<a href="http://www.explora.com/files/pharmacy/Lamotrigine.html" class="liexternal">Lamotrigine</a><br />
<a href="http://www.explora.com/files/pharmacy2/Nefazodone.html" class="liexternal">Nefazodone</a><br />
<a href="http://www.explora.com/files/via/Viagra-high-blood-pressure.html" class="liexternal">Viagra high blood pressure</a><br />
<a href="http://www.explora.com/files/cia/Cialis-levitra-sales-viagra.html" class="liexternal">Cialis levitra sales viagra</a><br />
<a href="http://www.explora.com/files/via/Prescription-free-viagra.html" class="liexternal">Prescription free viagra</a><br />
<a href="http://www.explora.com/files/cia/Purchase-cialis-online.html" class="liexternal">Purchase cialis online</a><br />
<a href="http://www.explora.com/files/pharmacy2/Trimethoprim.html" class="liexternal">Trimethoprim</a><br />
<a href="http://www.explora.com/files/pharmacy2/Lovenox.html" class="liexternal">Lovenox</a><br />
<a href="http://www.explora.com/files/xan/Xanax-long-term-use.html" class="liexternal">Xanax long term use</a><br />
<a href="http://www.explora.com/files/tra/Narcotic-tramadol.html" class="liexternal">Narcotic tramadol</a><br />
<a href="http://www.explora.com/files/pharmacy2/Piperidolate.html" class="liexternal">Piperidolate</a><br />
<a href="http://www.explora.com/files/hyd/Hydrocodone-drug.html" class="liexternal">Hydrocodone drug</a><br />
<a href="http://www.explora.com/files/via/Pfizer-viagra-sperm.html" class="liexternal">Pfizer viagra sperm</a><br />
<a href="http://www.explora.com/files/hyd/Hydrocodone-information.html" class="liexternal">Hydrocodone information</a><br />
<a href="http://www.explora.com/files/xan/Xanax-and-grapefruit.html" class="liexternal">Xanax and grapefruit</a><br />
<a href="http://www.explora.com/files/mer/Generic-meridia.html" class="liexternal">Generic meridia</a><br />
<a href="http://www.explora.com/files/phe/Phentermine-discount-no-prescription.html" class="liexternal">Phentermine discount no prescription</a><br />
<a href="http://www.explora.com/files/pharmacy2/Tyropanoate.html" class="liexternal">Tyropanoate</a><br />
<a href="http://www.explora.com/files/pharmacy/Fluconazole.html" class="liexternal">Fluconazole</a><br />
<a href="http://www.explora.com/files/pharmacy2/Meridia.html" class="liexternal">Meridia</a><br />
<a href="http://www.explora.com/files/pharmacy/Alka-seltzer.html" class="liexternal">Alka seltzer</a><br />
<a href="http://www.explora.com/files/via/Viagra-sales-uk.html" class="liexternal">Viagra sales uk</a><br />
<a href="http://www.explora.com/files/phe/Phentermine-37.5mg.html" class="liexternal">Phentermine 37.5mg</a><br />
<a href="http://www.explora.com/files/via/Viagra-cialis-levivia-comparison.html" class="liexternal">Viagra cialis levivia comparison</a><br />
<a href="http://www.explora.com/files/cia/Cialis-reviews.html" class="liexternal">Cialis reviews</a><br />
<a href="http://www.explora.com/files/via/Viagra-online-pharmacy.html" class="liexternal">Viagra online pharmacy</a><br />
<a href="http://www.explora.com/files/pharmacy/Insulin.html" class="liexternal">Insulin</a><br />
<a href="http://www.explora.com/files/via/Levivia-vs-viagra.html" class="liexternal">Levivia vs viagra</a><br />
<a href="http://www.explora.com/files/cia/Cheapest-cialis.html" class="liexternal">Cheapest cialis</a><br />
<a href="http://www.explora.com/files/pharmacy2/Keppra.html" class="liexternal">Keppra</a><br />
<a href="http://www.explora.com/files/pharmacy/Naproxen.html" class="liexternal">Naproxen</a><br />
<a href="http://www.explora.com/files/via/Viagra-and-high-blood-pressure.html" class="liexternal">Viagra and high blood pressure</a><br />
<a href="http://www.explora.com/files/phe/Best-phentermine-pharmacies-compare-links.html" class="liexternal">Best phentermine pharmacies compare links</a><br />
<a href="http://www.explora.com/files/pharmacy/Imodium.html" class="liexternal">Imodium</a><br />
<a href="http://www.explora.com/files/phe/Does-phentermine-help-weight-loss.html" class="liexternal">Does phentermine help weight loss</a><br />
<a href="http://www.explora.com/files/pharmacy2/Haldol.html" class="liexternal">Haldol</a><br />
<a href="http://www.explora.com/files/phe/Phentermine-37-5.html" class="liexternal">Phentermine 37 5</a><br />
<a href="http://www.explora.com/files/pharmacy/Fluticasone.html" class="liexternal">Fluticasone</a><br />
<a href="http://www.explora.com/files/phe/Phentermine-pharmacies.html" class="liexternal">Phentermine pharmacies</a><br />
<a href="http://www.explora.com/files/pharmacy/Cope.html" class="liexternal">Cope</a><br />
<a href="http://www.explora.com/files/amb/Ambien-overdose.html" class="liexternal">Ambien overdose</a><br />
<a href="http://www.explora.com/files/phe/Phentermine-90.html" class="liexternal">Phentermine 90</a><br />
<a href="http://www.explora.com/files/via/Viagra-samples-free.html" class="liexternal">Viagra samples free</a><br />
<a href="http://www.explora.com/files/via/Cheap-viagra.html" class="liexternal">Cheap viagra</a><br />
<a href="http://www.explora.com/files/via/Cheap-viagra-canada.html" class="liexternal">Cheap viagra canada</a><br />
<a href="http://www.explora.com/files/pharmacy2/Dyazide.html" class="liexternal">Dyazide</a><br />
<a href="http://www.explora.com/files/pharmacy2/Loperamide.html" class="liexternal">Loperamide</a><br />
<a href="http://www.explora.com/files/pharmacy2/Rabeprazole.html" class="liexternal">Rabeprazole</a><br />
<a href="http://www.explora.com/files/xan/Pfizer-xanax-pills.html" class="liexternal">Pfizer xanax pills</a><br />
<a href="http://www.explora.com/files/pharmacy/Prinivil.html" class="liexternal">Prinivil</a><br />
<a href="http://www.explora.com/files/phe/Phentermine-by-fedex.html" class="liexternal">Phentermine by fedex</a><br />
<a href="http://www.explora.com/files/via/Order-viagra-buying-viagra-uk.html" class="liexternal">Order viagra buying viagra uk</a><br />
<a href="http://www.explora.com/files/via/Sophia-viagra.html" class="liexternal">Sophia viagra</a><br />
<a href="http://www.explora.com/files/pharmacy2/Acetaminophen.html" class="liexternal">Acetaminophen</a><br />
<a href="http://www.explora.com/files/phe/Online-phentermine.html" class="liexternal">Online phentermine</a><br />
<a href="http://www.explora.com/files/via/Generic-viagra-uk.html" class="liexternal">Generic viagra uk</a><br />
<a href="http://www.explora.com/files/pharmacy2/Naltrexone.html" class="liexternal">Naltrexone</a><br />
<a href="http://www.explora.com/files/via/Sell-viagra.html" class="liexternal">Sell viagra</a><br />
<a href="http://www.explora.com/files/phe/Phentermine-90-day.html" class="liexternal">Phentermine 90 day</a><br />
<a href="http://www.explora.com/files/pharmacy2/Ethoheptazine.html" class="liexternal">Ethoheptazine</a><br />
<a href="http://www.explora.com/files/pharmacy/Catapres.html" class="liexternal">Catapres</a><br />
<a href="http://www.explora.com/files/tra/Tramadol-drug-test.html" class="liexternal">Tramadol drug test</a><br />
<a href="http://www.explora.com/files/phe/Free-shipping-phentermine.html" class="liexternal">Free shipping phentermine</a><br />
<a href="http://www.explora.com/files/pharmacy2/Amitriptyline.html" class="liexternal">Amitriptyline</a><br />
<a href="http://www.explora.com/files/pharmacy2/Divalproex.html" class="liexternal">Divalproex</a><br />
<a href="http://www.explora.com/files/pharmacy2/Propantheline.html" class="liexternal">Propantheline</a><br />
<a href="http://www.explora.com/files/phe/Phentermine-37.5-free-shipping.html" class="liexternal">Phentermine 37.5 free shipping</a><br />
<a href="http://www.explora.com/files/amb/Buy-ambien-online.html" class="liexternal">Buy ambien online</a><br />
<a href="http://www.explora.com/files/phe/Cheap-phentermine-37.5-mg.html" class="liexternal">Cheap phentermine 37.5 mg</a><br />
<a href="http://www.explora.com/files/xan/Xanax-in-early-pregnancy.html" class="liexternal">Xanax in early pregnancy</a><br />
<a href="http://www.explora.com/files/via/Online-ordering-viagra.html" class="liexternal">Online ordering viagra</a><br />
<a href="http://www.explora.com/files/phe/Pal-pay-phentermine.html" class="liexternal">Pal pay phentermine</a><br />
<a href="http://www.explora.com/files/pharmacy2/Cymbalta.html" class="liexternal">Cymbalta</a><br />
<a href="http://www.explora.com/files/pharmacy2/Amprenavir.html" class="liexternal">Amprenavir</a><br />
<a href="http://www.explora.com/files/pharmacy2/Lipitor.html" class="liexternal">Lipitor</a><br />
<a href="http://www.explora.com/files/phe/Phentermine-info.html" class="liexternal">Phentermine info</a><br />
<a href="http://www.explora.com/files/phe/Phentermine-success-stories.html" class="liexternal">Phentermine success stories</a><br />
<a href="http://www.explora.com/files/phe/Phentermine-online-prescriptions.html" class="liexternal">Phentermine online prescriptions</a><br />
<a href="http://www.explora.com/files/pharmacy2/Probenecid.html" class="liexternal">Probenecid</a><br />
<a href="http://www.explora.com/files/pharmacy2/Nitroglycerin.html" class="liexternal">Nitroglycerin</a><br />
<a href="http://www.explora.com/files/phe/Purchase-phentermine-online.html" class="liexternal">Purchase phentermine online</a><br />
<a href="http://www.explora.com/files/pharmacy2/Secobarbital.html" class="liexternal">Secobarbital</a><br />
<a href="http://www.explora.com/files/via/Buy-cheap-generic-viagra.html" class="liexternal">Buy cheap generic viagra</a><br />
</u><aid="more-17"></a></p>
<p>The calls are all stacked in the local <code>calls</code> variable. It&#8217;s not very complicated: calling <code>1.partial</code> returns a HigherOrderMessage object that&#8217;s ready to take a message (i.e., a method call) and append it to <code>calls</code>. So, calling <code>1.partial.succ</code> would result in yet another HigherOrderMessage object, but this time, the <code>calls</code> variable is set to <code>[[:succ, []]]</code>. When <code>1.partial.succ.+(1)</code> is called, the calls array for block in the returned object is <code>[[:succ, []], [:+, [1]]]</code>. And so it goes on forever, just appending method calls.</p>
<h3>First Attempt</h3>
<p>Not very exciting so far: some way to actually run all the calls in the array is needed. The idea is to define a special message that does not get stacked but instead loops through the stored calls and run them.</p>
<pre><code>public
def partial(calls=[])
  HigherOrderMessage.new do |id, *args|
    if id == :call
      calls.inject(self) do |n, i|
        n.__send__(i[0],*i[1])
      end
    else
      partial(calls.dup &lt;&lt; [id, args])
    end
  end
end</code></pre>
<p>Now the message <code>:call</code> is special. Instead of appending it to <code>calls</code>, it works as a signal that we want to run all the stacked up calls and return the result. <code>inject</code> is just the method needed to accomplish this, and already can some powerful things be accomplished.</p>
<pre><code>f = 1.partial.succ
f.call
=&gt; 2
4.partial.succ.*(2).call
=&gt; 10</code></pre>
<h3>Making It Better</h3>
<p>But we&#8217;re not done yet. It&#8217;s a bit static, almost like an alias. You can group together a series of calls and put it in a variable, but that&#8217;s it. We want something dynamic; we want to be able to have the partial <em>itself</em> accept arguments. It&#8217;s a lot of tweaking, but it&#8217;s possible.</p>
<pre><code>public
def partial(calls=[])
  HigherOrderMessage.new do |id, *args|
    if id == :call
      # User called :call: run all stored messages
      calls.inject(self) do |n, i|
        if i.equal?(calls.last)
          # If this is the last method call, pass all remaining
          # arguments to it.
          sargs = i[1] + args
        else
          # Try to figure out how many arguments to give this
          # method call.
          nargs = get_least_args(n,i[0]) - i[1].length
          nargs = 0 if nargs &lt; 0
          sargs = i[1] + args[0,nargs]
          args = args[nargs..-1]
        end
        n.__send__(i[0],*sargs)
      end
    else
      # Message id not :call, so just store the call arguments.
      partial(calls.dup &lt;&lt; [id, args])
    end
  end
end

f = 1.partial.+.*./.-
f.call(1,2,3,4)
=&gt; 11
g = 4.partial.+.succ
g.call(5)
=&gt; 10
h = [1,2,3].partial.-.do_map.+
h.call([2],10)
=&gt; [11,13]</code></pre>
<p>As you can see, the partial tries to figure out itself where the arguments go. When methods have variable number of arguments though, it only passes the required amount, since there&#8217;s no way to figure out how many you want to pass.</p>
<p>(<code>get_least_args</code> is simply a method that takes a method identifier (an object and a symbol), and returns the least number of arguments needed to call the provided method. It&#8217;s omitted here for brevity but is available in the source code below.)</p>
<h3>Finally</h3>
<p>I think partial functions could be useful. Maybe not in its current incarnation, but in my opinion it&#8217;s something that should be considered for inclusion in future Ruby versions. As for this lowly implementation, there are things to be done:</p>
<ul>
<li>Debug, debug, debug.</li>
<li>It&#8217;s probably possible to write another version of <code>call</code> (<code>explicit_call</code>, maybe?) where you explicitly state where the arguments go.</li>
<li>Figure out a way not to rely on <code>method_missing</code> (if only!)</li>
</ul>
<p>Source code:<br />
<a href="http://legacyofthemob.se/istari/partial.rb" class="liinternal">partial.rb</a><br />
<a href="http://legacyofthemob.se/istari/hom.rb" class="liinternal">hom.rb</a>
</p>
]]></content:encoded>
			<wfw:commentRSS>http://legacyofthemob.se/istari/2006/10/11/almost-partial-methods-using-higher-order-messaging/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Higher Order Messaging in Ruby</title>
		<link>http://legacyofthemob.se/istari/2006/10/08/higher-order-messaging-in-ruby/</link>
		<comments>http://legacyofthemob.se/istari/2006/10/08/higher-order-messaging-in-ruby/#comments</comments>
		<pubDate>Sun, 08 Oct 2006 20:24:08 +0000</pubDate>
		<dc:creator>Istarius</dc:creator>
		
	<category>Ruby</category>
		<guid isPermaLink="false">http://legacyofthemob.se/istari/2006/10/08/deus-ex-machina/</guid>
		<description><![CDATA[Having played around with Ruby for some six months now, I feel confident enough to make my first post on the subject...]]></description>
			<content:encoded><![CDATA[<p>Having played around with Ruby for some six months now, I feel confident enough to make my first post on the subject. It&#8217;s going be about Higher Order Messaging, and it&#8217;s more of an expansion on an excellent <a href="http://nat.truemesh.com/archives/000535.html" class="liexternal">description</a> by Nat Pryce. I&#8217;m writing this post partly because I feel my implementation is a tad better (less cumbersome, as one need not define a class for each new method), and partly because it feels like his post has gone largely unnoticed.</p>
<p>First of all, let&#8217;s talk about blocks. Anyone familiar with Ruby will have some knowledge of blocks. Blocks in Ruby is a way to pass a chunk of code as argument to a function; blocks are also full closures, so they may reference any variables that exist in the scope in which they were declared. An example of block usage:</p>
<pre>
<code>[0,1,2,3,4].select { |val| val.nonzero? }
=&gt; [1,2,3,4]</code>
</pre>
<p>As you may know, <code>Enumerable#select</code> loops through a collection and returns a new collection containing those elements for which the block evaluates to true. So, the example above produces the array <code>[1,2,3,4]</code>, since <code>Numeric#nonzero?</code> will return false for the first element in the array and true for the others.</p>
<p>I expect this is nothing new for most people. Often however, as in the above example, this syntax seems a little verbose.</p>
<p><aid="more-15"></a></p>
<h3>Using Symbols</h3>
<p>You may have come across a little method in the <a href="http://extensions.rubyforge.org/" class="liexternal">Ruby Extensions project</a> named <a href="http://blogs.pragprog.com/cgi-bin/pragdave.cgi/Tech/Ruby/ToProc.rdoc" class="liexternal">Symbol#to_proc</a>. In fact, it seems like this hack soon will be an official part of Ruby. Now to achieve the same results as the example above, we can use,</p>
<pre>
<code>[0,1,2,3,4].select(&amp;:nonzero?)
=&gt; [1,2,3,4]</code>
</pre>
<p>which is, if nothing else, more compact. Don&#8217;t get me wrong, I love this hack. But some object that this syntax is a bit ugly, and I agree partly, so we want to do this some other way, if possible. By understanding how calling methods works in Ruby, we can construct an alternate syntax.</p>
<h3>Using Higher Order Messaging</h3>
<p>Higher order messaging consists of the idea that <em>method calls</em> (messages), can be passed as arguments. I&#8217;ll spoil the surprise and show right away how our new syntax will look:</p>
<pre>
<code>[0,1,2,3,4].where.nonzero?
=&gt; [1,2,3,4]</code>
</pre>
<p>Looks good, doesn&#8217;t it? It looks like the method <code>where</code> takes a <em>method call</em> (<code>nonzero?</code>) as its argument, forwards it to each element and collects those for which it returns true. That is kind of what happens, but in a much more complicated way. Most of the magic lies in the <code>where</code> method; it returns an object that responds to <code>nonzero?</code>. The object that is returned from <code>where</code> is an instance of <code>HigherOrderMessage</code>:</p>
<pre>
<code>class HigherOrderMessage
  instance_methods.each { |method| undef_method(method) unless method =~ /__(.+)__/ }

  def initialize(&amp;proc)
    @proc = proc
  end

  def method_missing(id, *args)
    @proc.call(id, *args)
  end
end</code>
</pre>
<p>It might look a bit confusing, but it&#8217;s actually very simple. First note that all functions that aren&#8217;t vital (such as <code>__send__</code>) are unlinked, so they may not be called. Second, when constructing a HigherOrderMessage, a block must be supplied, which is stored in the object. Finally, <code>method_missing</code> is defined. This method is a bit special, because it&#8217;s called whenever another method doesn&#8217;t exist. The first parameter is the name of the method that was attempted; the second parameter is its arguments.</p>
<p>So far, this code does nothing. It&#8217;s a mere skeleton to build some functionality from. This is done by in the implemention of <code>Enumerable#where</code>:</p>
<pre>
<code>module Enumerable
  def where
    HigherOrderMessage.new do |id, *args|
      select { |x| x.__send__(id, *args) }
    end
  end
end

[0,1,2,3,4].where.nonzero?
=&gt; [1,2,3,4]</code>
</pre>
<p>Let&#8217;s dissect the example above; first <code>where</code> is called. What happens is that a new <code>HigherOrderMessage</code> object is created and returned (for brevity, this object will henceforth be referred to as <code>hom</code>). Furthermore, this object has one instance variable&#8212;<code>@proc</code>&#8212;that contains the code block that was passed to it.</p>
<p>Then, we&#8217;re trying to call <code>hom.nonzero?</code>. Since this method doesn&#8217;t exist, <code>hom.method_missing(:nonzero?)</code> is called instead. <code>method_missing</code> forwards the method id and its parameters to the block that is stored in <code>@proc</code>. This block consists of a call to select, which in our example evaluates to <code>{ |x| x.__send__(:nonzero?) }</code>, equivalent to <code>{ |x| x.nonzero? }</code>. Finally, the array that&#8217;s generated is returned.</p>
<p>Now you may realize why all defaults methods (those inherited from <code>Object</code>) were undefined: it&#8217;s simply so that all methods are forwarded to <code>method_missing</code>. Otherwise, <code>some_array.where.frozen?</code>, for example, wouldn&#8217;t work, because it would check whether the <code>HigherOrderMessage</code> object is frozen or not.</p>
<h3>Some Other Methods</h3>
<p>Let&#8217;s construct some other useful methods: <code>do_each</code>, <code>do_collect</code> and <code>do_inject</code>.</p>
<pre>
<code>module Enumerable
 def do_each
    HigherOrderMessage.new do |id, *args|
      each { |x| x.__send__(id, *args) }
    end
  end

  def do_collect
    HigherOrderMessage.new do |id, *args|
      collect { |x| x.__send__(id, *args) }
    end
  end

  # Requires Enumerable#inject
  def do_inject(start_value)
    HigherOrderMessage.new do |id, *args|
      inject(start_value) { |a,x| a.__send__(id, x, *args) }
    end
  end
end

a, b = [0,1], [1,2]
[a,b].do_each &lt;&lt; 3
[a,b]
=&gt; [[0, 1, 3], [1, 2, 3]]
[0,1,2,3,4].do_inject(0).+
=&gt; 10
[0,1,2,3,4].do_collect * 2
=&gt; [0,2,4,6,8] </code>
</pre>
<p>The first line adds a new element, 3, to the array. The second like computes and returns the sum of the given array: 10. The third maps the message *(2) to all elements in the array. All examples demonstrate something that would have been impossible to do with <code>Enumerable#to_symbol</code>: when passing a method call you pass both the method name and its arguments, but when you pass a symbol that&#8217;s converted to a proc you can&#8217;t pass any arguments. Thus, you could never do <code>[a,b].each(&amp;:&lt;&lt;(3))</code>.</p>
<p>Of course, even more complex stuff can be done. Here&#8217;s an example of a method that, seemingly, takes two methods as parameters.</p>
<pre>
<code>module Enumerable
  def having
    HigherOrderMessage.new do |id, *args|
      HigherOrderMessage.new do |secid, *secargs|
        select { |x| x.__send__(id, *args).__send__(secid, *secargs) }
      end
    end
  end
end

[0,1,2,3,4].having.succ &lt; 3
=&gt; [0,1]</code>
</pre>
<p>The <code>having</code> method, apart from being very useful, demonstrates something interesting about higher order messaging: it can be chained. Not only does <code>having</code> return a <code>HigherOrderMessage</code> instance, even the block in <code>@proc</code> returns one! That means that <code>[0,1,2,3,4].having.succ</code> returns a <code>HigherOrderMessage</code> object that takes yet another function (in our case, <code>&lt;</code>), applies <code>succ</code> to each element and checks it against <code>&lt;(3)</code>. Note that this is different than <code>[0,1,2,3,4].succ.where &lt; 3</code>, which would return an array of successors rather than objects from the original array.</p>
<p>A warning: while operators like &lt;, &gt;, ==, and so on may be used in these functions, != mustn&#8217;t. From my understanding this is due to <code>a != b</code> being a short form of <code>!(a == b)</code>. (E.g., <code>[0,1,2,3,4].succ.where != 3</code> would expand to <code>!([0,1,2,3,4].do_collect.succ.where == 3)</code>, which is <code>false</code>.</p>
<h3>Final Words</h3>
<p>This is not meant as a replacement for blocks in collection manipulation, but maybe a replacement for <code>Symbol#to_proc</code>. Higher order messaging has, in my opinion, the following advantages:</p>
<ul>
<li>The syntax less wordy than using a block.</li>
<li>It&#8217;s more flexible than using <code>Symbol#to_proc</code> since you&#8217;re effectively forwarding a method call rather than just a method.</li>
</ul>
<p>It&#8217;s not without its problems though. First of all, I&#8217;d like to see a version where we can drop the &#8220;do_&#8221; part of the methods that already exist in <code>Enumerable</code>, and instead have a general function that can either take a block and work like normal, or not take one and behave like a higher order message. And secondly, the implementation itself: right now, this is more of a hack than anything else. It&#8217;s probably slower than using a block. And it&#8217;s not really tested. At all.</p>
<p><a href="http://legacyofthemob.se/istari/hom.rb" class="liinternal">Source code.</a>
</p>
]]></content:encoded>
			<wfw:commentRSS>http://legacyofthemob.se/istari/2006/10/08/higher-order-messaging-in-ruby/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Bring the Noise</title>
		<link>http://legacyofthemob.se/istari/2006/09/11/bring-the-noise/</link>
		<comments>http://legacyofthemob.se/istari/2006/09/11/bring-the-noise/#comments</comments>
		<pubDate>Mon, 11 Sep 2006 12:25:44 +0000</pubDate>
		<dc:creator>Istarius</dc:creator>
		
	<category>Uncategorized</category>
		<guid isPermaLink="false">http://legacyofthemob.se/istari/2006/09/11/bring-the-noise/</guid>
		<description><![CDATA[Last week, I bought a new mic, after my old one had gone broken. I&#8217;m not using it for anything serious, just for voice communication when playing games...]]></description>
			<content:encoded><![CDATA[<p>Last week, I bought a new <a href="http://www.webhallen.com/prod.php?id=25539" class="liexternal">mic</a>, after my old one had gone broken. I&#8217;m not using it for anything serious, just for voice communication when playing games. So I needed something small and cheap I could clip on to the headphones cord.</p>
<p>Funny thing is, it worked like a charm (figuratively) first evening. No problems at all. Next day, however, something had happened. I hadn&#8217;t rebooted the computer or changed any settings from what I remembered, but something had happened. The mic still picked up my voice when I spoke, but more faintly than before and there was a constant humming noise not there the day before.</p>
<p>The next few days got weirder. Sometimes it worked, sometimes it didn&#8217;t. It had nothing to do with settings, and it seemed very strange that the mic would already be broken. Then one day, I noticed something peculiar. The noise level seemed to be different depending on where the microphone was located in the room! Finally, I found that placing the mic on top of the computer, the noise was virtually none.</p>
<p>What did I learn from this? Turn off noise suppression. When the mic had sat all night on top of the computer case it had adjusted to the noise from the fans and HDDs; after I picked it up the mic tried to suppress noise that was no longer present.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://legacyofthemob.se/istari/2006/09/11/bring-the-noise/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Not So Prestigious</title>
		<link>http://legacyofthemob.se/istari/2006/08/05/not-so-prestigious/</link>
		<comments>http://legacyofthemob.se/istari/2006/08/05/not-so-prestigious/#comments</comments>
		<pubDate>Sat, 05 Aug 2006 21:01:38 +0000</pubDate>
		<dc:creator>Istarius</dc:creator>
		
	<category>Personal</category>
		<guid isPermaLink="false">http://legacyofthemob.se/istari/2006/08/05/not-so-prestigious/</guid>
		<description><![CDATA[One soon to be released movie that has won my attention is The Prestige. Not only for its outstanding cast, not only because Christopher Nolan directs, but also because the story seemed interesting...]]></description>
			<content:encoded><![CDATA[<p>One soon to be released movie that has won my attention is <a href="http://www.imdb.com/title/tt0482571/" class="liimdb">The Prestige</a>. Not only for its outstanding cast, not only because Christopher Nolan directs, but also because the story seemed interesting. It interested me so much in fact, that when I realized it was based on a <a href="http://www.amazon.co.uk/gp/product/0575075805/" class="liexternal">book</a>, I shortly after bought it.</p>
<p>Apparently, The Prestige is Christopher Priest&#8217;s ninth book. A writer I had never heard of, but on Amazon, most of his books have received much praise&#8212;many even praising The Prestige as his finest work. Instead of writing a review there, I&#8217;m writing one here. That way I don&#8217;t have to worry about posting spoilers. For there will be some, and if you want to read the book or see the movie and don&#8217;t want to be spoiled, stop reading now.</p>
<p>A short synopsis: The working class son Alfred Borden and the aristocrat Rupert Angier, two stage magicians, are in a on-going feud in the end of the 19th century. Their attempts to best one another consist of publically humiliate the other one by revealing how his act is done, and, perhaps even more, by devising an act the other one cannot figure out. Borden invents the trick he calls &#8220;The New Transported Man,&#8221; as his magnus opus. Angier replies by coming up with his own illusion under the name of &#8220;In a Flash.&#8221;</p>
<p>The story is given in a set of different accounts, in different styles and in different time spans (and sometimes, overlapping). The two main stories are the accounts from the two magicians themselves. It&#8217;s interesting to see the the differences and the similarities between the two main characters, and how their accounts differ in style and contents (partly because they focus on things that make them look good, but also because they remember things differently and selectively). I had some trouble with the narrative style in the beginning but began to accept it after a while (the first few pages are in fact the worst).</p>
<p>However, when I read about this book I was led to believe that it was going to be full of mysteries and twists, and it really isn&#8217;t. The two main mysteries in this book are about the two big illusions, and they are never really mysteries at all. The secret of &#8220;The New Transported Man&#8221; is pretty much revealed after about 60-70 pages, and the secret surrounding &#8220;In a Flash&#8221; is just, well, magic. Let&#8217;s just say it&#8217;s like finding out in the end of a closed-room murder mystery that a &#8220;a wizard did it!&#8221;; at first you expect a logical explanation, but in the end it&#8217;s just paranormal hogwash.</p>
<p>My expectations were probably too high when I started reading this, but I really think you&#8217;re doing a bad job of selling it if you describe it as a mystery novel.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://legacyofthemob.se/istari/2006/08/05/not-so-prestigious/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Countdown</title>
		<link>http://legacyofthemob.se/istari/2006/07/23/countdown/</link>
		<comments>http://legacyofthemob.se/istari/2006/07/23/countdown/#comments</comments>
		<pubDate>Sun, 23 Jul 2006 19:19:10 +0000</pubDate>
		<dc:creator>Istarius</dc:creator>
		
	<category>TV and Movies</category>
		<guid isPermaLink="false">http://legacyofthemob.se/istari/2006/07/23/countdown/</guid>
		<description><![CDATA[(I&#8217;m writing this post mainly for my own benefit, but if it interests anyone, all the better...]]></description>
			<content:encoded><![CDATA[<p>(I&#8217;m writing this post mainly for my own benefit, but if it interests anyone, all the better.)</p>
<p>Here is the unofficial countdown for shows&#8212;shows I&#8217;m interested in&#8212;returning or premiering this fall:</p>
]]></content:encoded>
			<wfw:commentRSS>http://legacyofthemob.se/istari/2006/07/23/countdown/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Pilots to the Left of Me; Pilots to the Right of Me</title>
		<link>http://legacyofthemob.se/istari/2006/07/23/pilots-to-the-left-of-me-pilots-to-the-right-of-me/</link>
		<comments>http://legacyofthemob.se/istari/2006/07/23/pilots-to-the-left-of-me-pilots-to-the-right-of-me/#comments</comments>
		<pubDate>Sun, 23 Jul 2006 19:03:03 +0000</pubDate>
		<dc:creator>Istarius</dc:creator>
		
	<category>TV and Movies</category>
		<guid isPermaLink="false">http://legacyofthemob.se/istari/2006/07/23/pilots-to-the-left-of-me-pilots-to-the-right-of-me/</guid>
		<description><![CDATA[Never before have I been so diligent in watching pilots for new shows, no, generally I have no idea what&#8217;s new on TV until it airs, and often even later than that...]]></description>
			<content:encoded><![CDATA[<p>Never before have I been so diligent in watching pilots for new shows, no, generally I have no idea what&#8217;s new on TV until it airs, and often even later than that.</p>
<p>First up is a drama/mystery show called <a href="http://www.tv.com/secrets-of-a-small-town/show/58470/summary.html" class="liexternal">The Secrets of a Small Town</a>. In the small town of Santa Ruiz, two twin girls go missing after a party. Shortly after, one of them is found dead, murdered. The whole community is shaken by the event, which makes national news. A young reporter, Bethany, initially from Santa Ruiz but who left some eight years ago to persue her career, relunctantly agrees to return to her home town in order to cover the story. Her sense that going back might be a mistake is partly validated by a difficult reunion with her sister, the local sheriff.</p>
<p>Although in a genre I&#8217;m particularly fond of, I&#8217;m not sure about this show. It has a slight <i>Point Pleasant</i> feel about it, and I mean that in a bad way. (Is there any good way to remember <i>Point Pleasant</i>?) It&#8217;s the kind of show I believe must be story-driven, rather than character-driven, if it should succeed. I&#8217;ll say one thing positive though, I can&#8217;t wait to see the next episode.</p>
<p>Another one that seemed worth checking out is <a href="http://www.tv.com/angelas-eyes/show/60070/summary.html" class="liexternal">Angela&#8217;s Eyes</a>. Angela, a twenty-something woman working for the FBI, has the unique gift of being able to tell when people are lying. She supposedly got this gift because her parents were spies working against USA. I might have tuned out there a while, because it didn&#8217;t really make sense.</p>
<p>The whole concept seems a bit weak to me. It&#8217;s slightly reminiscent of <i>Psych</i> (although this show is not a comedy), and maybe even more of <i>Alias</i>&#8212;another show I never liked. I might be a bit biased: I normally hate these slick agency type of shows. They&#8217;re always a tad too unrealistic for me to accept. I&#8217;ll just leave it at that.</p>
<p>The third up could very well be my favorite for today: <a href="http://www.tv.com/heroes/show/17552/summary.html" class="liexternal">Heroes</a>. All over the world, people are discovering they have different super-hero powers. They don&#8217;t know why it&#8217;s happening, it just is; but a vision of the future shows a burning New York, and it&#8217;s not a huge leap to suggest that our new heroes are supposed to try to stop this from happening.</p>
<p>I love it so far. It&#8217;s one of those shows where I don&#8217;t care about the fine details. I mean, it was a bit ridiculous every time they tried to scientifically explain something, but the show doesn&#8217;t <em>rely</em> on it (<i>Numb3rs</i> comes to mind, yuck), so it doesn&#8217;t matter. Otherwise, the acting and writing seemed solid. It shows all promise to be a highly entertaining show with an interesting story.</p>
<p>Got any interesting new shows to tell about? Feel free!
</p>
]]></content:encoded>
			<wfw:commentRSS>http://legacyofthemob.se/istari/2006/07/23/pilots-to-the-left-of-me-pilots-to-the-right-of-me/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>The Shows Must Go On</title>
		<link>http://legacyofthemob.se/istari/2006/07/16/the-shows-must-go-on/</link>
		<comments>http://legacyofthemob.se/istari/2006/07/16/the-shows-must-go-on/#comments</comments>
		<pubDate>Sun, 16 Jul 2006 11:04:40 +0000</pubDate>
		<dc:creator>Istarius</dc:creator>
		
	<category>TV and Movies</category>
		<guid isPermaLink="false">http://legacyofthemob.se/istari/2006/07/16/the-shows-must-go-on/</guid>
		<description><![CDATA[Man, there are sure a lot of new pilots turning up these days. I already wrote about Jericho in an earlier post, so that one can be skipped.
After Jericho, it was time for Traveler...]]></description>
			<content:encoded><![CDATA[<p>Man, there are sure a lot of new pilots turning up these days. I already wrote about Jericho in an <a href="http://legacyofthemob.se/istari/2006/07/14/jake-fought-the-battle-of-jericho/" class="liinternal">earlier post</a>, so that one can be skipped.</p>
<p>After Jericho, it was time for <a href="http://www.tv.com/traveler/show/58473/summary.html" class="liexternal">Traveler</a>. Seems this show won&#8217;t air until January 2007, and I sure can&#8217;t wait. This show has everything: a fascinating story, excellent writing, and good enough acting.</p>
<p>Jay, Tyler and Will, three young men freshly out of college, decide to celebrate their graduating with a road trip. Their first stop being New York, they begin by visiting <i>The Drexler Museum of Art</i>&#8212;non-existant in the real world. Either way, Will (who dragged them there) suggests that, as a prank, they race down from the top of the museum on rollerblades. While Will lingers behind, Jay and Tyler race through the building. Shortly after exiting, they get a phone call from their friend left behind, who says nothing else than that he&#8217;s sorry. A moment a later, a explosion goes off inside the museum. As Jay and Tyler are identified as chief suspects, they realize they&#8217;ve been set up. We learn via Tyler&#8217;s father that someone knew that this would happen, because that someone made a lot of money on it&#8212;or at least avoided losing a lot of money.</p>
<p><i>Speculation</i>: Will is pretty much the bad guy right now. Jay and Tyler can&#8217;t even prove he ever existed! Nevertheless, I can&#8217;t help but think this&#8217;ll turn out the next <i>24</i>: there&#8217;s definitely a larger conspiracy here. Before they can prove their innocence, Jay and Tyler will continue to run from the FBI and the police. I highly doubt Will is dead. He even had an escape vehicle ready! (Remember, he parked the car in another garage.) But who is the black guy helping Jay and Tyler escape from the police van, and what&#8217;s the deal with Will filming everything?</p>
<p>Next one up is <a href="http://www.tv.com/the-nine/show/58501/summary.html" class="liexternal">The Nine</a>. What seems like a regular day turns into a nightmare for the people who happened to be in the Fidelity Republic Bank. Two bank robbers storm into the bank sometime in the afternoon. Cut to 52 hours later; we see a hostage situation that took place inside the bank finally being resolved. Evidently, something had gone wrong in the robbery and the robbers started taking hostages. We learn that one of the nine shot one of the robbers, who ends up in a coma, and subsequently, the police managed to take control over the situation. At least one person lost its life in the situation: Eva, a bank teller.</p>
<p>The nine people who are hostages to the end are: Jeremy (surgeon), Lizzie (nurse, Jeremy&#8217;s girl friend), Malcolm (bank branch manager), Eva (bank teller, killed), Franny (bank teller, Eva&#8217;s sister) Felicia (Malcolm&#8217;s daughter), Egan Foote (office employee, shot one of the robbers), Nick Kavanaugh (police officer), Kathryn (assistant DA).</p>
<p><i>Speculation</i>: After the event, we continue to follow the lives of the nine and how they all cope differently with what happened. This show will not, however, turn into a drama about how they get on with their lives. I believe we&#8217;ll learn that one of the hostages was, in fact, &#8220;in on it.&#8221; Egan&#8217;s life has changed for the better, but is he really that innocent? His behaviour at the bank was a bit erratic. Malcolm didn&#8217;t want his daughter inside the bank; did he know something? All of the nine are such unlikely suspects, ironically meaning it can be either one.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://legacyofthemob.se/istari/2006/07/16/the-shows-must-go-on/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Jake Fought the Battle of Jericho</title>
		<link>http://legacyofthemob.se/istari/2006/07/14/jake-fought-the-battle-of-jericho/</link>
		<comments>http://legacyofthemob.se/istari/2006/07/14/jake-fought-the-battle-of-jericho/#comments</comments>
		<pubDate>Fri, 14 Jul 2006 15:20:12 +0000</pubDate>
		<dc:creator>Istarius</dc:creator>
		
	<category>TV and Movies</category>
		<guid isPermaLink="false">http://legacyofthemob.se/istari/2006/07/14/jake-fought-the-battle-of-jericho/</guid>
		<description><![CDATA[This fall everybody will be saying Jericho this and Jericho that. At least, that&#8217;s what CBS hopes. And after seeing the pilot, I think they&#8217;re justified in their belief...]]></description>
			<content:encoded><![CDATA[<p>This fall everybody will be saying <a href="http://www.tv.com/jericho-2006/show/58068/summary.html" class="liexternal">Jericho</a> this and <a href="http://www.cbs.com/primetime/upfront_2006/jericho.shtml" class="liexternal">Jericho</a> that. At least, that&#8217;s what CBS hopes. And after seeing the pilot, I think they&#8217;re justified in their belief.</p>
<p>The premise: Jericho, a small town in Kansas, is cut off from the outside world shortly after a huge explosion (causing a familiar mushroom-shaped cloud) is seen in the direction of Denver. Left without electricity and not knowing what&#8217;s going on, the citizens drift towards panic.</p>
<p>From there, it can really go anywhere and my hopes are very high for the story. There are some problems, however. For instance, some scenes I just didn&#8217;t buy&#8212;the mass panic, the speech of the mayor to calm people down, etc.&#8212;and seemed rather cliché. Something that never stopped shows like Prison Break, though. Another is the acting. Maybe surprisingly, Skeet Ulrich (Jake) did a rather well job, but otherwise, it felt a little bleak. I am skeptically positive. If they can make it fly, it&#8217;ll fly far.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://legacyofthemob.se/istari/2006/07/14/jake-fought-the-battle-of-jericho/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Ice Queen</title>
		<link>http://legacyofthemob.se/istari/2006/07/13/ice-queen/</link>
		<comments>http://legacyofthemob.se/istari/2006/07/13/ice-queen/#comments</comments>
		<pubDate>Thu, 13 Jul 2006 21:04:47 +0000</pubDate>
		<dc:creator>Istarius</dc:creator>
		
	<category>TV and Movies</category>
		<guid isPermaLink="false">http://legacyofthemob.se/istari/2006/07/13/ice-queen/</guid>
		<description><![CDATA[Yesterday, I saw a movie I&#8217;ve been awaiting for some time now: Hard Candy. Although it wasn&#8217;t exactly what I had expected, I think it was great...]]></description>
			<content:encoded><![CDATA[<p>Yesterday, I saw a movie I&#8217;ve been awaiting for some time now: <a href="http://www.imdb.com/title/tt0424136/" class="liimdb">Hard Candy</a>. Although it wasn&#8217;t exactly what I had expected, I think it was great. Without giving away the plot, I can say that paedophelia and torture (there are no graphic scenes though, it&#8217;s all psychological) are major themes. That may scare away some, but if you&#8217;re only going to see one movie about paedophelia and torture this year, make it this one.</p>
<p>The acting is superb, both by Patrick Wilson and Ellen Page (whom, after looking at her IMDb profile, I recall seeing in <em>ReGenesis</em>), and that&#8217;s really what makes this film work. All in all, Hard Candy manages to walk a fine line in a controversial subject without being too biased. Eight thumbs up!
</p>
]]></content:encoded>
			<wfw:commentRSS>http://legacyofthemob.se/istari/2006/07/13/ice-queen/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>The Ultimate</title>
		<link>http://legacyofthemob.se/istari/2006/07/11/the-ultimate/</link>
		<comments>http://legacyofthemob.se/istari/2006/07/11/the-ultimate/#comments</comments>
		<pubDate>Tue, 11 Jul 2006 20:07:23 +0000</pubDate>
		<dc:creator>Istarius</dc:creator>
		
	<category>MMA</category>
		<guid isPermaLink="false">http://legacyofthemob.se/istari/?p=3</guid>
		<description><![CDATA[The past weekend UFC 61: Bitter Rivals was held. It sure had promise! Ken Shamrock and Tito Ortiz was one of the most anticipated matches this year...]]></description>
			<content:encoded><![CDATA[<p>The past weekend <a href="http://en.wikipedia.org/wiki/UFC_61" title="UFC 61 on Wikipedia" class="liwikipedia"><em>UFC 61: Bitter Rivals</em></a> was held. It sure had promise! <a href="http://en.wikipedia.org/wiki/Ken_Shamrock" title="Ken Shamrock on Wikipedia" class="liwikipedia">Ken Shamrock</a> and <a href="http://en.wikipedia.org/wiki/Tito_Ortiz" title="Tito Ortiz on Wikipedia" class="liwikipedia">Tito Ortiz</a> was one of the most anticipated matches this year. Ah, and how I longed for <a href="http://en.wikipedia.org/wiki/Andrei_Arlovski" title="Andrei Arlovski on Wikipedia" class="liwikipedia">Andrei Arlovski</a> vs <a href="http://en.wikipedia.org/wiki/Tim_Sylvia" title="Tim Sylvia on Wikipedia" class="liwikipedia">Tim Sylvia</a> to fight again. At their previous encounter, Arlovski&#8217;s loss was due to over-eagerness. But, instead of something great, UFC 61 turned out one of the most disappointing UFC events I have ever seen.</p>
<p>If you&#8217;ve seen the fights, you&#8217;ll know that the Ortiz-Shamrock match was finished rather quickly. Tito got an early takedown and ferociously started dropping elbows. After four or five hits the judge stepped in and stopped it, since  Ken wasn&#8217;t defending himself intelligently. 1:18 it lasted. I have seen people defending themselves a lot less intelligently for a much longer time before the judge decides to step in. While the safety of the fighters are important, in this case the judge robbed the audience and the fighters of the match that should&#8217;ve been.</p>
<p>Sylvia vs Arlovski was sort of the opposite. For the first two rounds were interesting; one was waiting for either a big punch from Sylvia or a combo from Arlovski. As the rounds went on it got boring. It&#8217;s ridiculous a fight like that lasts five rounds. I blame Arlovski&#8211;had he only been more aggressive it would have been more exciting.</p>
<p>None of the other fights were very impressive either. <a href="http://en.wikipedia.org/wiki/Frank_Mir" title="Frank Mir on Wikipedia" class="liwikipedia">Frank Mir</a> is still really rusty and unlikely to get back to his former level. You&#8217;ve got to admire that he&#8217;s continued fighting, though. Joe Stevenson&#8217;s and Josh Burkman&#8217;s fights were possibly the highlights of the event. And honestly, those fights were average at best.</p>
<p>Nevertheless, awesome news that <a href="http://en.wikipedia.org/wiki/Wanderlei_Silva" title="Wanderlei Silva on Wikipedia" class="liwikipedia">Wanderlei Silva</a> and <a href="http://en.wikipedia.org/wiki/Chuck_Liddell" title="Chuck Liddell on Wikipedia" class="liwikipedia">Chuck Liddell</a> will fight on November 18, provided Chuck defends his title against Babalu. My money is on Wanderlei, but you never know. Additionally, <a href="http://www.mmafighting.com/news/2006/pridefc_vs_ufc_november.html" class="liexternal">MMAFighting.com</a> reports that other Pride fighters will step into the octagon for this event.</p>
<p>Update: Seems like Wanderlei and Chuck won&#8217;t fight after all. Pity.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://legacyofthemob.se/istari/2006/07/11/the-ultimate/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>

