2009/2/3 T.J. Crowder <t...@crowdersoftware.com>:
>
> Hi,
>
>> Maybe filter should be an alias of findall for arrays, but shouldn't
>> it really return a hash for hashes?
>
> FWIW (and it ain't much, I'm not a decision maker on Prototype stuff),
> in my opinion it would be an _extremely_ bad idea for Hash to break
> the contract documented for Enumerable.
>
>> ...in ruby, which Prototype is supposed to be modeled after.
>
> Prototype has been split off from Ruby for a long time now.  I'd
> venture to say that most people using Prototype do not use and may
> well never have even seen Ruby.  PHP seems to be the server-side
> language I see most in code snippets from people asking questions.

Hey, he's talking about me! The only reason I have Ruby installed is
so that I can get the fixes to main git source into my test bed.

rake dist... etc.

Never written a single line of Ruby code.


> --
> T.J. Crowder
> tj / crowder software / com
> Independent Software Engineer, consulting services available
>
>
> On Feb 3, 2:04 pm, disccomp <discc...@gmail.com> wrote:
>> Maybe filter should be an alias of findall for arrays, but shouldn't
>> it really return a hash for hashes? Especially if thats its behavior
>> in ruby, which Prototype is supposed to be modeled after.
>>
>> On Feb 3, 4:59 am, "T.J. Crowder" <t...@crowdersoftware.com> wrote:
>>
>> > Hi Brad,
>>
>> > Sorry, I missed that Hash inherits from Enumerable (and I've filed a
>> > doc bug on it[1] and will fix it -- the doc page for Hash doesn't
>> > mention Enumerable).
>>
>> > So I think that's your answer:  Hash#filter is an alias for
>> > Enumerable#findAll[2], which is documented as returning an array, not
>> > a Hash, and so having it return a Hash would be breaking the contract.
>>
>> > [1]http://prototype.lighthouseapp.com/projects/8886-prototype/tickets/535
>> > [2]http://prototypejs.org/api/enumerable/findall
>>
>> > Sorry again to have missed the Enumerable thing in the first place.
>> > --
>> > T.J. Crowder
>> > tj / crowder software / com
>> > Independent Software Engineer, consulting services available
>>
>> > On Feb 3, 12:25 am, Brad <bradavo...@gmail.com> wrote:
>>
>> > > It does. Hash still inherits from Enumerable, hence the usage of
>> > > Hash#findAll().
>>
>> > > - Brad
>>
>> > > On Feb 2, 1:34 am, ColinFine <colin.f...@pace.com> wrote:
>>
>> > > > On Jan 31, 11:11 pm, Brad <bradavo...@gmail.com> wrote:
>>
>> > > > > Yup, found it -http://dev.rubyonrails.org/ticket/3592
>>
>> > > > > It is indeed a bug in Prototype that hasn't been addressed.
>>
>> > > > > - Brad
>>
>> > > > But it seems to me that it's gone away, because Hash no longer mixes
>> > > > in Enumerable, does it?
>>
>> > > > Colin
>>
>>
> >
>



-- 
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to