From: Yukihiro Matsumoto Date: 2000-02-29T12:07:59+09:00 Subject: [ruby-talk:01635] Re: Ruby: constructors, new and initialise The following message is a courtesy copy of an article that has been posted to comp.lang.misc as well. Hi, Dave Thomas writes: |> For example, if you want to create initialized SortedArray |> by specifying elements like |> |> ary = SortedArray(1,5,4,3,7,3) |> |> you just can't. I feel this as restriction. | |That's true. But in what way is that different to any class where the |constructor takes different parameters to it's subclass? The biggest difference is redefining `initialize' works when `new' don't work. Changing number of arguments in subclass is a bad habit in general, but `new' serves little bit differently, because it never (well, seldom) be used polymorphic. In fact Ruby called `initialize' for these classes before, just like you proposed. In these days I received several complains like: `initialize' would not work as I expect, it requires fixed number of arguments, etc. matz.