On Mar 5, 9:42 am, Yusuke ENDOH <[email protected]> wrote:
> Hi,
>
> 2009/3/6 Jeremy Evans <[email protected]>:
>
> > I don't like this implementation.  Allowing the boolean AND and OR
> > operators to take no arguments makes no sense.
>
> Hmm, I feel that it is natural for AND operator to return true if
> it takes no arguments:
>
>   [].all? { false } #=> true

But is it natural for the OR operator to return false if no arguments
are present?  AND is different from ruby's all?, and OR is different
than ruby's any?.  Or at least I think it should be treated
differently.

> Aha, I did not know that filter can be used more than once.
> I'll try to reconsider my source code.

Note that filter! modifies its receiver, while filter returns a
modified copy.  Generally filter should be used, but if you are
already working with a copy that isn't used by anything else, using
filter! is fine (which is what my example did via clone).

Jeremy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to