thanks david!

> I don't get the "should" part....

i just mean "should" as in what seems most "common sense", though not
always the same for everyone, but in general, for instance, if i call
#include? on a Hash, it makes sense if it checks the values like Array
does, not the index. that's all.

no i'm not saying there's something wrong with the way these things
work, obviously they work and are useable. only that i think it is
better the more consitent things are, across the board. not only for
being more "intuitive", but you'll notice in my humble attempt at
"normalizing" that more method definitons are removed, hence a cleaner
tighter system.

i beleive it was einstien who said "simplify! but not too simple." okay,
that's a paraphrase. but the idea is that it is important to simplify
matters as much as possible, just as long as the comparable
functionality remains.

i'll definitly check out the threads and comments. thanks again!

~transami


On Sun, 2002-07-14 at 20:02, David Alan Black wrote:
> Hi --
> 
> On Mon, 15 Jul 2002, Tom Sawyer wrote:
> 
> > so i tried my hand at including count in Enumberable and "normalizing"
> > String and Hash accordingly. take a look at the attached script to see
> > how the current design is a tad odd, versus how these changes effect it.
> 
> [...]
> 
> > Hash is seriously inept at being normalized, as #include? should be
> > synonomous with has_value? and #count? should count on values. thus
> > #each needs to mean #each_value. trying to "normalize" Hash leads to
> 
> I don't get the "should" part....  Having #include? do something
> different from #has_value? shouldn't be a problem, since #has_value?
> is available.  (That argument doesn't count for much if #include? is
> doing something inherently bad, but I don't think it is.)  It's not a
> winner-take all situation :-)
> 
> > filling it with all sorts of methods: #detect_key, #detect_pair,
> > #count_key, #count_pair...etc." This all stems from the fact that Hash
> > isn't really Enumberable. #each_with_index, for instance, is
> > meaningless, since a Hash is unordered, and the components of a Hash,
> > the pairs (x=>y) aren't true objects in themselves.
> 
> I completely agree.  In fact, see the thread starting at
> [ruby-talk:11272].  Even now, I still don't think I've ever seen
> Hash#each_with_index used, nor have I ever been able to think of a
> hypothetical case where one would use it (since the idea of retrieving
> unordered elements in numerical "order" is inherently useless).
> 
> I don't know whether it merits language-level change, since it can
> always just be ignored (it's sort of inert, in that sense), though my
> instincts, like yours, are to see Enumerable as something of an
> amalgam of something like Enumerable and Iterable.  There's been at
> least some chatting about this here (and I thought there was a little
> bit recently, but I couldn't find it) -- search on "iterable" at
> ruby-talk.org and you'll see some comments.
> 
> 
> David
> 
> -- 
> David Alan Black
> home: dblack / candle.superlink.net
> work: blackdav / shu.edu
> Web:  http://pirate.shu.edu/~blackdav
> 
> 
-- 
~transami

  _(")_  dobee dobee do...
   \v/  
   ^ ^