Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

raiph:

I was looking over the documentation you linked to, and came across "Parcel Objects":

The comma operator (infix:<,>) creates Parcel objects. These should not be confused with lists; a Parcel represents a raw syntactic sequence of elements. A Parcel is immutable, although the elements of a Parcel may be either mutable or immutable.

The name "Parcel" is derived from the phrase "parenthesis cell", since many Parcel objects appear inside of parentheses. However, except for the empty parcel, it's the comma operator that creates Parcel objects.

    ()       # empty Parcel
    (1)      # an Int
    (1,2)    # a Parcel with two Ints
    (1,)     # a Parcel with one Int

A Parcel is also Positional, and uses flattening context for list operations such as .[] and .elems. See "Flattening contexts" below. For raw access to the arguments without flattening, you may use .arg($n) instead of .[$n], and .args instead of .elems.

This looks confusing to me: Isn't there a concern that there appear to be two special cases* leading to different results here? It seems to me that having (1) evaluate to an integer and the others evaluate to a parcel could be problematic. What's the thought behind that?

The second oddity in that document is in the section "The .infinite method". The table looks wrong:

    .infinite     Meaning
    ----------------------------------------------
    True          iteration is known to be infinite
    False         iteration is known to be finite
    Mu            finiteness isn't currently known

I'm no expert, but I'm pretty sure that The Daily WTF? clearly established that the third state of a boolean value is FILE_NOT_FOUND.</ribbing>

Notes:

* The second special case being empty parenthesis evaluating to a parcel.

...roboticus

When your only tool is a hammer, all problems look like your thumb.


In reply to Re^12: A "Perl-7" that I could actually USE right now by roboticus
in thread A "Perl-7" that I could actually USE right now by sundialsvc4

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-04-18 16:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found