Enhancement request

Rob Kinyon <[email protected]> Fri, 11 Feb 2005 12:49:03 -0500
Newsgroups gmane.comp.lang.perl.modules.class-methodmaker
Message-ID <[email protected]>
I'm using 2.05 on Solaris with Perl 5.8.4, standard build.

I've got the following code:

use Class::MethodMaker [
    new => 'new',
    scalar => [
        { -type => 'Some::Class', -default_ctor => 'new' },
        'some_class',
    ],
];

I'd like to be able to specify something that would allow for the
following test to pass:

$object->some_class_reset();
ok(
    !$object->some_class_isset(),
    "I just reset the damn thing, so it shouldn't be set yet!",
);

Currently, the code in scalar.pm says that if a default is specified,
the attribute is consider to be always set, even if it isn't actually
set yet.

I understand the design decision behind this, but I'd like to be able
to override it, if possible.

Thanks,
Rob Kinyon

p.s. I posted about this on Perlmonks at
http://www.perlmonks.org/?node_id=430184


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click