Skip Menu |

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

Report information
The Basics
Id: 27837
Status: resolved
Priority: 0/
Queue: Class-Std

People
Owner: Nobody in particular
Requestors: steve [...] vance.com
Cc:
AdminCc:

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



Subject: Class::Std Issues
Date: Sat, 30 Jun 2007 08:11:48 -0400
To: bug-class-std [...] rt.cpan.org
From: Stephen Vance <steve [...] vance.com>
I've been using Class::Std for a few weeks and have found some things that I think aren't working or at least aren't completely documented:
  1. The 'name' variable trait doesn't seem to work. The get_ and set_ methods weren't created.
  2. The 'init_arg' variable trait seems to make the argument mandatory for the constructor. This is not documented if that is what is intended.
  3. In combination with 'init_arg' the 'default' variable trait silences any complaints about the argument not being supplied, but also doesn't initalize the argument properly. It is always undefined. Is it being initialized from the hash where it's not supplied after the default is being set?
I'm using perl 5.8.8 built from source on Mac OS X 10.4.9.

Steve

From: DMUEY [...] cpan.org
On Sat Jun 30 08:12:21 2007, steve@vance.com wrote: Show quoted text
> I've been using Class::Std for a few weeks and have found some things > that I > think aren't working or at least aren't completely documented:
Could you post some brief code that demonstrates said behavior? thanks
Subject: Re: [rt.cpan.org #27837] Class::Std Issues
Date: Mon, 02 Jul 2007 13:01:11 -0400
To: bug-Class-Std [...] rt.cpan.org
From: Stephen Vance <steve [...] vance.com>
I've attached code for #2. Notice that an exception is thrown if no value is supplied for the attribute.

Simple tests of #1 and #3 aren't behaving as I described, so I'm going back to my code history to see if I can refine the issue.

Steve

 via RT wrote: Show quoted text
<URL: http://rt.cpan.org/Ticket/Display.html?id=27837 >

On Sat Jun 30 08:12:21 2007, steve@vance.com wrote:
  
 I've been using Class::Std for a few weeks and have found some things
that I
think aren't working or at least aren't completely documented:
    
Could you post some brief code that demonstrates said behavior?

thanks

  
package InitArgUsage; use strict; use warnings; use Class::Std; { my %attr_of : ATTR( init_arg => 'attr' ); } 1;
use strict; use warnings; use InitArgUsage; my $class = InitArgUsage->new();
From: DMUEY [...] cpan.org
Show quoted text
> I've attached code for #2. Notice that an exception is thrown if no value is supplied for the
attribute. If you give it a "default => 'whatver'," does it not throw an exception? Show quoted text
> Simple tests of #1 and #3 aren't behaving as I described, so I'm going back to my code
history to see if I can refine the issue. ok,let me know once you have an exmple, thanks!
CC: JDHEDDEN [...] cpan.org
Subject: Re: [rt.cpan.org #27837] Class::Std Issues
Date: Mon, 02 Jul 2007 16:57:59 -0400
To: bug-Class-Std [...] rt.cpan.org
From: Stephen Vance <steve [...] vance.com>
Adding a default works, but what if I'm okay with undef? If I default to undef, it behaves the same way.

Steve

 via RT wrote: Show quoted text
<URL: http://rt.cpan.org/Ticket/Display.html?id=27837 >

  
I've attached code for #2. Notice that an exception is thrown if no value is supplied for the 
    
attribute.

If you give it a "default => 'whatver'," does it not throw an exception?
Subject: [document] default and init_arg erros if undef or not supplied
On Mon Jul 02 17:59:47 2007, steve@vance.com wrote: Show quoted text
> Adding a default works, but what if I'm okay with undef? If I default > to > undef, it behaves the same way.
If I understand what you're saying, I think Damian has already addressed it here: http://rt.cpan.org/Ticket/Display.html?id=15427 If so this rt will be about making it clearer in the docs, if not please elaborate for me :) thanks!
CC: jdhedden [...] cpan.org
Subject: Re: [rt.cpan.org #27837] [document] default and init_arg erros if undef or not supplied
Date: Wed, 26 Mar 2008 14:29:27 +1000
To: bug-Class-Std [...] rt.cpan.org
From: Stephen Vance <steve [...] vance.com>
That answers the question.

Thanks,
Steve

Daniel Muey via RT wrote: Show quoted text
<URL: http://rt.cpan.org/Ticket/Display.html?id=27837 >

On Mon Jul 02 17:59:47 2007, steve@vance.com wrote:
  
 Adding a default works, but what if I'm okay with undef? If I default
to
undef, it behaves the same way.
    
If I understand what you're saying, I think Damian has already addressed it here:

http://rt.cpan.org/Ticket/Display.html?id=15427

If so this rt will be about making it clearer in the docs, if not please elaborate for me :)

thanks!



  

-- 
Stephen Vance
www.vance.com