isn't this just odd for oddness' sake?

we agree that there's a need to instantiate objects of a class. there's no
argument there.

but instead of passing blocks to a method (add_progress_monitor, say) that
are part of the definition of the class, this solution adds per-instance
methods whose name is known only by convention.

i don't know, maybe i should give in and learn to love dynamic typing and
instance-specific behavior. but it gives me great difficulty when there are
perfectly adequate traditional solutions to the same problem. this
suggestion seems to suffer from similar problems to the String-keyed Hash,
to me. to take whytheluckystiff's example, if i accidentally write

  def uri.progress_Bar( percent_done )
    puts "Yeah, we're at " + percent_done + "% now!"
  end

instead of

  def uri.progress_bar( percent_done )
    puts "Yeah, we're at " + percent_done + "% now!"
  end

the only indication i'll have of this is that my program will silently do
the wrong thing at run-time. [this problem occurs with overriding of
non-abstract methods in most languages, too.]

i also can't see how you could extend this to support a multiple listeners
instead of just one. it's more like set_progress_monitor than
add_progress_monitor, which may be fine in this instance, but the general
point still stands.

is there something that instance-specific behavior gains us in this instance
that passing blocks (or even, if you insist, using a delegate class in the
style of Objective-C) doesn't?

 --elliott

-----Original Message-----
From: Thomas Sawyer [mailto:transami / runbox.com]
Sent: 2003-11-20 23:43
To: ruby-core / ruby-lang.org
Subject: Re: open-uri patch, added progress_proc hook


_why! you are a a genius! i read your page, plain brilliance. i think once 
people start thinking in those terms a lot of "interface" designs will
change 
and become much more elegant and robust.

tanaka are you getting this? see why's page: google://whytheluckystiff.

-t0


the duck marches on!



*********************************************************************
This e-mail and any attachment is confidential. It may only be read, copied and used by the intended recipient(s). If you are not the intended recipient(s), you may not copy, use, distribute, forward, store or disclose this e-mail or any attachment. If you are not the intended recipient(s) or have otherwise received this e-mail in error, you should destroy it and any attachment and notify the sender by reply e-mail or send a message to sysadmin / bluearc.com
*********************************************************************