I've always felt that it's bad form to give a method two distinctly
different responsibilities.
'pluck' implies getting a property... setting the property should be
named differently (IMHO).

If there is confusion regarding the Enumerable methods, then it should
be dealt with in documentation rather than implementation.

Just my $0.02.

- Skip




On 8/14/07, kangax <[EMAIL PROTECTED]> wrote:
>
> Nice one, Tom!
>
> As far as naming I'd rather go with same pluck but with optional
> second argument for setting value
>
> $$('#myFormId input').pluck('disabled'); // getter
> $$('#myFormId input').pluck('disabled', true); // setter
>
> You have no idea how much confusion there's among beginners as far as
> figuring out all these "weird" Enumerable methods (specially if you're
> not familiar with Ruby).
> Introducing another one, I believe, would bring even more chaos.
>
> P.S.
>
> Since we're on this subject, has anyone ever considered having case-
> insensitive flag for Array's without method.
>
> $('nav').descendants().pluck('tagName').without('LI') (i.e. when
> dealing with HTML vs XML case issues)
>
> I know, this case is pretty trivial and could be simply done with
> selectors:
>
> $$('#nav li a')
>
> but wouldn't it be still usefull to have such option?
>
> Best,
> kangax
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to