Skip Menu |

This queue is for tickets about the Class-Load CPAN distribution.

Report information
The Basics
Id: 76931
Status: resolved
Priority: 0/
Queue: Class-Load

People
Owner: Nobody in particular
Requestors: xenoterracide [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.19



Subject: a method that returns the class name
Date: Tue, 1 May 2012 19:43:46 -0500
To: bugs-class-load <bugs-class-load [...] rt.cpan.org>
From: Caleb Cushing <xenoterracide [...] gmail.com>
this kind of goes along with my load_class_ok, but it'd be without the Test::Builder... not sure what the function would be called... my $class = ret_class( 'Class::Foo' ); # or exception this would also allow my $obj = ret_class('Class::Foo')->new(); -- Caleb Cushing http://xenoterracide.com
Subject: Re: [rt.cpan.org #76931] a method that returns the class name
Date: Tue, 1 May 2012 19:55:23 -0500
To: Caleb Cushing via RT <bug-Class-Load [...] rt.cpan.org>
From: Jesse Luehrs <doy [...] cpan.org>
On Tue, May 01, 2012 at 08:43:54PM -0400, Caleb Cushing via RT wrote: Show quoted text
> this kind of goes along with my load_class_ok, but it'd be without the > Test::Builder... not sure what the function would be called... > > my $class = ret_class( 'Class::Foo' ); # or exception > > this would also allow > > my $obj = ret_class('Class::Foo')->new();
I don't see why load_class itself couldn't just be modified to do this (use_module from Module::Runtime does this, for instance). Having a separate function for it seems odd. -doy
Subject: Re: [rt.cpan.org #76931] a method that returns the class name
Date: Tue, 1 May 2012 20:16:30 -0500
To: bug-Class-Load [...] rt.cpan.org
From: Caleb Cushing <xenoterracide [...] gmail.com>
On Tue, May 1, 2012 at 7:55 PM, Jesse Luehrs via RT <bug-Class-Load@rt.cpan.org> wrote: Show quoted text
> I don't see why load_class itself couldn't just be modified to do this > (use_module from Module::Runtime does this, for instance). Having a > separate function for it seems odd.
it's possible that it could? I'm not really sure how Class::Load works in the guts, or what kind of an API would be desire-able. I am more interested in reducing my Lines of Code. my $obj = try { load_class('Foo')->new; } ... seems far preferable to my $obj = try { my $class = 'Foo'; load_class('Foo'); $foo->new; } or (obviously different use case ) use Foo; my $obj = Foo->new; obviously these seems silly but when the class name is 46 characters long it starts seeming less silly -- Caleb Cushing http://xenoterracide.com
Subject: Re: [rt.cpan.org #76931] a method that returns the class name
Date: Thu, 3 May 2012 19:04:45 -0500
To: bug-Class-Load [...] rt.cpan.org
From: Caleb Cushing <xenoterracide [...] gmail.com>
Subject: Re: [rt.cpan.org #76931] a method that returns the class name
Date: Fri, 18 May 2012 13:44:26 -0500
To: bug-Class-Load [...] rt.cpan.org
From: Caleb Cushing <xenoterracide [...] gmail.com>
I've also determined that `load_class` in https://metacpan.org/module/Plack::Util behaves in the way I've suggested (and a little more it seems) -- Caleb Cushing http://xenoterracide.com