[#3006] CVS repository — "Eugene Scripnik" <hoaz@...>

Hello.

21 messages 2004/06/16
[#3008] Re: CVS repository — ts <decoux@...> 2004/06/16

>>>>> "E" == Eugene Scripnik <hoaz@gala.net> writes:

[#3009] Re: CVS repository — Michal Rokos <michal@...> 2004/06/16

Hi!

[#3057] Ruby 1.8.2 to be released. — matz@... (Yukihiro Matsumoto)

Hi,

20 messages 2004/06/23

Re: member? / include?

From: Johan Holmberg <holmberg@...>
Date: 2004-06-04 22:05:25 UTC
List: ruby-core #2966
On Sat, 5 Jun 2004, Johan Holmberg wrote:
>
> It would seem natural to me that methods that are described as
> synonyms/aliases are treated as a "unit" in the implementation too.
> For example that both are re-implemented together in a "subclass".
>

Another example where this isn't the case is in the String class:

    str = "abc\ndef\n"

    p str.member?("c\nd")           # => false
    p str.include?("c\nd")          # => true

    p str.member?("def")            # => false
    p str.include?("def")           # => true

    p str.member?("def\n")          # => true
    p str.include?("def\n")         # => true

Maybe I haven't learned to think enough in Ruby yet ;-),
but just now I'm getting one surprise after another ....

/Johan Holmberg


In This Thread