[#407] New feature for Ruby? — Clemens.Hintze@...

Hi all,

27 messages 1999/07/01
[#413] Re: New feature for Ruby? — matz@... (Yukihiro Matsumoto) 1999/07/01

Hi Clemens,

[#416] Re: New feature for Ruby? — Clemens Hintze <c.hintze@...> 1999/07/01

On Thu, 01 Jul 1999, Yukihiro Matsumoto wrote:

[#418] Re: New feature for Ruby? — gotoken@... (GOTO Kentaro) 1999/07/01

Hi

[#426] Re: New feature for Ruby? — gotoken@... (GOTO Kentaro) 1999/07/02

Hi,

[#440] Now another totally different ;-) — Clemens Hintze <c.hintze@...>

Hi,

21 messages 1999/07/09
[#441] Re: Now another totally different ;-) — matz@... (Yukihiro Matsumoto) 1999/07/09

Hi,

[#442] Re: Now another totally different ;-) — Clemens Hintze <c.hintze@...> 1999/07/09

On Fri, 09 Jul 1999, you wrote:

[#443] — Michael Hohn <hohn@...>

Hello,

26 messages 1999/07/09
[#444] interactive ruby, debugger — gotoken@... (GOTO Kentaro) 1999/07/09

Hi Michael,

[ruby-talk:00459] Re: Now another totally different ;-)

From: Akira Endo <akendo@...3.rim.or.jp>
Date: 1999-07-12 00:55:14 UTC
List: ruby-talk #459
Hi, gotoken,

In [ruby-talk:00452] Re: Now another totally different ;-)
gotoken@math.sci.hokudai.ac.jp (GOTO Kentaro) wrote:

> By the way, Matz, why the following doesn't print "b\n" but 10?
> 
> module Indexed
>   def [](n)
>     to_a[n]
>   end
> end
> 
> class String
>   include Indexed
> end
> 
> if __FILE__
>   p "abcdefg".gsub(/./,"\\&\n")[1]
> end

"p String.ancestors" gives [String, Indexed, Enumerable, Comparable,
Object, Kernel].
That means that the module Indexed is a Mix-in, such as a superclass,
and the method [] is first searched in String.  This is added to
RubyFAQ.

                          Though this is not the subject, I know.
-- 
Akira Endo, akendo@t3.rim.or.jp

In This Thread