I have to say, that having read a bit more about C::MM and how it works, I disagree with teh change you are making.

You question (in the tests) is:

  • "If I've reset() an attribute and not yet done a get() or set(), why does it test as isset()?"

    And I would say, because it has a default.

    Therefore if you did do a get(), a value would be returned, and that value would be a real value--even if it was undef because the default was set to be undef.

    So, the envisioned use of _isset is to allow the caller to determine if they will get a legitimate value when they call get()--even if when they do call it they get undef.

    But you appear to be trying to use isset() as if it were isreset(), or possibly _isdefault().

    Which may be a desirable test to be able to perform for some reason other than testing that _reset() works--which is C::MM's test suite responsibility, not yours--but if it is, then it has different semantics to _isset and should probably be a different method.


    Examine what is said, not who speaks.
    Silence betokens consent.
    Love the truth but pardon error.

    In reply to Re^3: Class::MethodMaker, workplace politics, and patches by BrowserUk
    in thread Class::MethodMaker, workplace politics, and patches by dragonchild

    Title:
    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.