I probably overstated my point about the immutability of the smart match dispatch table. My negative reaction upon learning that this table could not be changed stemmed from the idea that one of the strengths of a dispatch table over a hard-coded battery of if-statements (or a switch statement in C, for that matter), is that the dispatch table can be modified during runtime. In fact, such a table can be built by the program from scratch (e.g. upon parsing a configuration file, for example). Therefore it comes as a let down to find something called "dispatcher" (which is strongly suggestive of a dispatch table) that cannot be modified at runtime.

It really boils down to the nebulous concept of "programmer's expectations". My comments here are just one data point; you probably need a few more :-) .

How about changing the name of the main function from "dispatcher" to "switch" (as I think you once had it)? In this way you would not be telegraphing an implementation detail that, in this case at least, turns out to be a bit confusing.

the lowliest monk


In reply to Re^3: RFC: Case package documentation by tlm
in thread RFC: Case package documentation by Roy Johnson

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.