[ruby-talk:00344] Re: Struct.new

From: gotoken@... (GOTO Kentaro)
Date: 1999-05-26 04:57:01 UTC
List: ruby-talk #344
Greetings!

In message "[ruby-talk:00343] Re: Struct.new"
    on 99/05/26, Yukihiro Matsumoto <matz@netlab.co.jp> writes:
>patch).  But I want to discuss whether we should choose this behavior
>or not.  What do you guys (other than Pros) think about this?

Struct? I've hardly used it...

Because St.new() looks something like Array.new(2), I think it is
suitable to return nil for member which is not set. 

By analogy Array.new, I feel a necessity of an optional way to specify 
defualt value for each member.  For example, 
Struct.new("St", :first, :second, [0,0]). But it is too complex maybe.

-- gotoken

In This Thread