Hello --

Quite a busy Ruby Tuesday today.  I wanted to add to it a few thoughts
about what is rapidly (whether or not permanently) coming to be known
as GULP.  (My favorite part of which is that it's "plug" backwards :-)

Some of this may sound strange, and it's a bit soul-search-ish, but
hopefully in a way that's reasonably relevant Ruby-wide.

I've been very interested particularly in the development of an
on-line cookbook, as well as the various archive and library ideas
that have been circulating recently.  And yet, when I've tried to
really sit down and sketch out how things might work, I've hit a kind
of impasse.  My latest analysis of this is that what's behind this
impasse is, of all things, the very power of Ruby.

For example -- and this is just one quick example from recent threads
here -- we've been talking about the question of adding a block to
Hash.new, and the various pros and cons of that, what one could do,
couldn't do, etc.  At one level, of course, all of this discussion and
deliberation is perfectly appropriate (as well as instructive).  And
yet, once I start hacking around with it, I find that I can *easily*
get this to happen, and to work, certainly within striking distance of
a quite robust implementation, in about ten lines of code (including
several lines that are just setting aliases).

So... I then start thinking, this language is *so* powerful that you
could just piggyback, trivially, all sorts of fairly profound
enhancements to the language on your scripts.  And if someone else
wanted to do it a little differently, they could, and that would be
fine, because if I write:

  def default(arg)
    block ? block.call(self, arg) : olddef
  end

and someone else wants to write:

  def default(arg)
    if block
      block.call(self, arg)
    else
      od = olddef
      if od.is_a? Proc then od.call else od end
    end
  end

because they want that behavior in their program, it won't really
matter.  (I don't mean this choice doesn't matter in the actual
discussions going on about the core language.  I mean that, if someone
wanted to have a program with this behavior, they could do so without
negative impact on anyone else.)

I am not saying that everything can travel with a script, or be done
in a wide variety of flavors without problems.  (No, really, I *do*
know about encapsulation and non-duplication of code and various other
things.)  I'm just saying that I find myself running up against the
fact that there is so much one can do in Ruby *before* one has to
worry really deeply about namespaces, module branching, partitioning
of effort, etc.  I mean, a language where you can just say, "Well, for
this script I think I want hashes to accept blocks" -- and ten lines
later they do -- !!

In the end, the promise of this is that the archives and cookbooks and
everything will be *really* amazing :-)  And I want all that stuff to
happen.  I guess I'm just still getting my mind around the whole thing
-- the way Ruby sort of lets you eat the tablecloth -- and eager to
come up with ideas for archiving and cookbooking that offer a lot to
people while allowing the genie to remain out of the bottle.


David

-- 
David Alan Black
home: dblack / candle.superlink.net
work: blackdav / shu.edu
Web:  http://pirate.shu.edu/~blackdav