On Monday 24 November 2003 09:15 pm, Sean E Russell wrote:
> On Monday 24 November 2003 14:28, Nathaniel Talbott wrote:
> > What would you use in REXML if you had it to do over again? Will you
> > eventually (for Ruby 2?) deprecate symbol keyed hash arguments in REXML,
> > and move to something else?
>
> I don't know, and yes.
>
> "I don't know," because there isn't a good alternative to what I was trying
> to do.  I'd probably get rid of, or hide from the users, the constructor
> hash entirely, and force them to use methods.  I tell you, I've answered
> more questions about the proper use of those stupid argument hashes than
> any other single thing in REXML.  The thing is that it even confuses *me*,
> when I have to go back and deal with it.

While not suited to data parameters, when passing blocks I still find the idea 
of a "raised reporting" compelling, something like:

  begin
    open(url)
  report :progress_proc, bytes_loaded
    puts "Yeah, we've got #{bytes_loaded}% bytes now!"  
  end
  
  # in open_uri
   ...
    resp = Net::HTTP.start(self.host, self.port) { |http|
        http.get(uri.to_s, header) { |str|
          buf << str
          courier :progress_proc, buf.io.pos  # <<
        }
      }
   ...

I think it is a pretty elegant solution, but obviously Ruby doesn't have this 
facility.

>  I'll be really happy when we get named parameters.

me too.

-t0