« Return to Thread: Draft SIP: From constructors to factories: Uniform treatment of object creation

Re: Draft SIP: From constructors to factories: Uniform treatment of object creation

by David MacIver :: Rate this Message:

Reply to Author | View in Thread

2009/4/2 martin odersky <martin.odersky@...>:

> On Tue, Mar 24, 2009 at 1:16 AM, Raoul Duke <raould@...> wrote:
>>>> Summary: Make it easy to switch from constructors to factories after
>>>> the fact by adding a mechanism where "new Foo(stuff)" can translate to
>>>> an invocation of a user defined method on the companion object.
>>
>> could we instead just try to do away with 'new' pretty please perhaps?
>>
> I also think that would be the nicer generalization. I have not
> thought about this or the SIP too much recently. So I'm not quite sure
> what to think of it.

I'd be totally ok with doing away with new in lieu of this SIP if
someone can come up with a decent proposal for doing so. :-)

 « Return to Thread: Draft SIP: From constructors to factories: Uniform treatment of object creation