Is there a way to generate an object without new?

2005-10-27 Thread Yiyi Hu
What I want to do, is a bit like... class A { has $.b; method show { $.b.say }; }; A( b = 5 ).show;` Thanks, Xinming

Re: Is there a way to generate an object without new?

2005-10-27 Thread Luke Palmer
On 10/27/05, Yiyi Hu [EMAIL PROTECTED] wrote: What I want to do, is a bit like... class A { has $.b; method show { $.b.say }; }; A( b = 5 ).show;` Yes, I definitely want this to be the way that case type instances are created: all those .news everywhere could get annoying. Anyway,

Re: Is there a way to generate an object without new?

2005-10-27 Thread Juerd
Yiyi Hu skribis 2005-10-28 3:17 (+0800): class A { has $.b; method show { $.b.say }; }; A( b = 5 ).show;` This is how some other language construct objects, but not how Perl does it. In other words: you should not want this. Perhaps it is possible to have a class export a sub to its user.

Re: Is there a way to generate an object without new?

2005-10-27 Thread Matt Fowles
Juerd~ On 10/27/05, Juerd [EMAIL PROTECTED] wrote: Yiyi Hu skribis 2005-10-28 3:17 (+0800): class A { has $.b; method show { $.b.say }; }; A( b = 5 ).show;` This is how some other language construct objects, but not how Perl does it. In other words: you should not want this. How

Re: Is there a way to generate an object without new?

2005-10-27 Thread Juerd
Matt Fowles skribis 2005-10-27 15:52 (-0400): This is how some other language construct objects, but not how Perl does it. In other words: you should not want this. How does that logically follow? They are two ways of expressing what I think. If they said exactly the same thing, I wouldn't

Re: Is there a way to generate an object without new?

2005-10-27 Thread Larry Wall
On Thu, Oct 27, 2005 at 01:30:44PM -0600, Luke Palmer wrote: : On 10/27/05, Yiyi Hu [EMAIL PROTECTED] wrote: : What I want to do, is a bit like... : : class A { : has $.b; : method show { $.b.say }; : }; : : A( b = 5 ).show;` : : Yes, I definitely want this to be the way that case type