[ruby-list:37818] Re: 配列の使い方

From: IWAOKA Masahiro <iwaoka@...>
Date: 2003-06-23 13:14:20 UTC
List: ruby-list #37818
In the message <20030623213319.DF59.TIETEW-ML-RUBY-LIST@tietew.net>,
  on Mon, Jun 23, 2003 at 09:34:51PM +0900, Tietew wrote:
>   @@ary = (1..3).collect { Hoge.new }

おぉっ、すっきりしてる。と思ったのですが、

>   @@ary = (1..3).collect { Hoge.new }

ならば問題なくて、

  p (1..3).collect { Hoge.new }

とすると undefined method `collect' for nil (NameError) となってし
まうのは何故でしょうか?

いわおか

In This Thread