A port of Dwemthy's Array to JavaScript
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README
dwemthy.js

README

dwemthy.js

A port of Dwemthy's Array into JavaScript.
---

Why the Lucky Stiff created a fantastic example of Ruby
metaprogramming with his "Dwemthy's Array". 
  See http://poignantguide.net/dwemthy/

This is an exploration of how the same topics translate into
JavaScript, for my own edification.

How to play:
   Load dwemthy.js into your favorite JavaScript console - it must
   support __noSuchMethod__, so Rhino, SpiderMonkey, Firefox - these
   are your best bets.

   js> load("dwemthy.js");
   js> var r = new Rabbit();
   js> var da = new DwemthysArray().of(new IndustrialRaverMonkey(),
                           new DwarvenAngel(),
                           new AssistantViceTentacleAndOmbudsman(),
                           new TeethDeer(),
                           new IntrepidDecomposedCyclist(),
                           new Dragon());
   js> r.slice(da);

   ...etc