i'm sorry, perhaps i wasn't clear. i was using bar/baz and zip/zap as non-constant/constant pairs. you are correct in that an empty prototype is a necessary condition for a subroutine to be optimized to a constant.

and truly, thanks for this code. i've been working on a module (possibly named Devel::TrackSub,) which will wrap all subs in any namespaces you specify. it'll be posted as soon as i finish the pod--perhaps tomorrow.

developing this code was my first attempt at walking the symbol table, and at first seemed a little over my head. i think i've found an elegant solution that can be quite instrumental to others. i'm excited to post it soon.

i think you've done the same here.

~Particle *accelerates*


In reply to Re^3: (Segfault) Re: is_constant() - a routine that detects constant subs by particle
in thread is_constant() - a routine that detects constant subs by samtregar

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.