I cannot think of a sensible way to make the smart-match dispatch table modifiable. With the string-table, there's no order of tests, so I can just stick the new test in without regard for where it goes. With the smart-match, there is an order of tests. Do you have suggestions for this?

I think of modifying the table as a kind of nifty feature that is likely to be little-used. Why do you see it as important?

The default case does need to be at the end of the list. I will make that explicit in the docs.

You're probably right about treating ranges as unordered. That's actually a fix where I get to remove code. I had thought it would be a convenience. I also toyed with the idea of a reversed pair signifying "not between". But I don't think there's any value in that, either.

The perplexing paragraph can probably be removed. It is in anticipation of people considering it a misfeature not to handle arrayrefs as arrayrefs. It merely points out that instead of

[ $arrayref ] => sub { something }, # if it handled arrayrefs as arra +yrefs
you could actually do
$arrayref => sub { something } , # treat $arrayref as a list of te +sts
and
# instead of [ $arrayref, 'foo' ] => sub { something }, # do this $arrayref => sub { Case::resume() }, [ 'foo' ] => sub { something },
I greatly appreciate your comments.

Caution: Contents may have been coded under pressure.

In reply to Re^2: RFC: Case package documentation by Roy Johnson
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.