Re: Instantiation

2004-08-24 Thread Simon Cozens
[EMAIL PROTECTED] (Aaron Sherman) writes: > > my $x = Some::Module::That::Defines::A::Class.AUTOLOAD.new("blah"); > > Wow, that's pretty amazing... uh... I think I'd just prefer to do it > the old fashioned way. If my suggestion was really that horrific, I > withdraw the question. These days, to

Re: Instantiation

2004-08-23 Thread Aaron Sherman
Dave Whipp wrote: "Sean O'Rourke" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] my $x = (use Some::Module::That::Defines::A::Class).new("blah"); how about some variation on my $x = Some::Module::That::Defines::A::Class.AUTOLOAD.new("blah"); Wow, that's pretty amazing...

Re: Instantiation

2004-08-23 Thread Dave Whipp
"Sean O'Rourke" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > my $x = (use Some::Module::That::Defines::A::Class).new("blah"); how about some variation on my $x = Some::Module::That::Defines::A::Class.AUTOLOAD.new("blah"); Dave.

Re: Instantiation

2004-08-23 Thread Sean O'Rourke
At Mon, 23 Aug 2004 15:51:00 -0400, [EMAIL PROTECTED] (Aaron Sherman) wrote: > > On Mon, 2004-08-23 at 15:19, Paul Seamons wrote: > > > So, I was wondering about a synonym, like: > > > > > > uses Some::Module::That::Defines::A::Class $foo; > > > > Well if the long name is the problem: > > > >

Re: Instantiation

2004-08-23 Thread Ingo Blechschmidt
Hello, Aaron Sherman wrote: > I was thinking about the case where you use a module, only to define a > class that you then instantiate like this: [ snip ] > So, I was wondering about a synonym, like: > > uses Some::Module::That::Defines::A::Class $foo; is $foo implicitely declared as our or my (

Re: Instantiation

2004-08-23 Thread Matthew Walton
Aaron Sherman wrote: I was thinking about the case where you use a module, only to define a class that you then instantiate like this: use Some::Module::That::Defines::A::Class; our Some::Module::That::Defines::A::Class $foo := new; and I keep thinking that that's too redundant. It'

Re: Instantiation

2004-08-23 Thread Jonathan Scott Duff
On Mon, Aug 23, 2004 at 12:53:04PM -0400, Aaron Sherman wrote: > I was thinking about the case where you use a module, only to define a > class that you then instantiate like this: > > use Some::Module::That::Defines::A::Class; > our Some::Module::That::Defines::A::Class $foo := new; >

Re: Instantiation

2004-08-23 Thread Aaron Sherman
On Mon, 2004-08-23 at 15:19, Paul Seamons wrote: > > So, I was wondering about a synonym, like: > > > > uses Some::Module::That::Defines::A::Class $foo; > > Well if the long name is the problem: > > use Some::Module::That::Defines::A::Class as Foo; No, like I said: this is not golf. I'm tryi

Re: Instantiation

2004-08-23 Thread Paul Seamons
> So, I was wondering about a synonym, like: > > uses Some::Module::That::Defines::A::Class $foo; Well if the long name is the problem: use Some::Module::That::Defines::A::Class as Foo; my Foo $obj .= new; # OR # require Some::Module::That::Defines::A::Class; import Some::Module::That::D

Re: Instantiation

2004-08-23 Thread Juerd
Aaron Sherman skribis 2004-08-23 12:53 (-0400): > use Some::Module::That::Defines::A::Class; > our Some::Module::That::Defines::A::Class $foo := new; > and I keep thinking that that's too redundant > (...) > So, I was wondering about a synonym, like: > uses Some::Module::That::Def

Instantiation

2004-08-23 Thread Aaron Sherman
I was thinking about the case where you use a module, only to define a class that you then instantiate like this: use Some::Module::That::Defines::A::Class; our Some::Module::That::Defines::A::Class $foo := new; and I keep thinking that that's too redundant. It's not so much that

Re: Object Instantiation

2002-10-15 Thread Peter Haworth
On Fri, 11 Oct 2002 14:05:30 -0700, Michael Lazzaro wrote: > Maybe postfix ! on a class name means to autoinstantiate an object of > the named class only if/when first accessed: > > our FancyCache $cache; # declare, but leave undef > our FancyCache! $cache;

Re: Object Instantiation

2002-10-11 Thread Michael Lazzaro
On Thursday, October 10, 2002, at 05:11 PM, Larry Wall wrote: my MyClass $obj = .new; my new MyClass $obj; Thanks for the clarification. I like those two OK, personally. If I were chained to one of those, I wouldn't chew my leg off. Tying it together with the other thread to mak

Re: Object Instantiation (Was: Re: [ANNOUNCE] Perl6 OO Cookbook, v0.1)

2002-10-10 Thread Larry Wall
od is called, where conversion from undef is equivalent to an argumentless .new(). : As far as the syntax for type declarations: I have less bees about : this one. Clearly, : : my $obj is MyClass; : : should declare a variable of type MyClass. (You're right, it shouldn't

Object Instantiation (Was: Re: [ANNOUNCE] Perl6 OO Cookbook, v0.1)

2002-10-10 Thread Michael Lazzaro
of the class, there is no new() at all.) As far as the syntax for type declarations: I have less bees about this one. Clearly, my $obj is MyClass; should declare a variable of type MyClass. (You're right, it shouldn't autoviv.) So what's the simplest syntax for typi