Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: (tye)Re: Scalars, Lists, and Arrays

by merlyn (Sage)
on Apr 13, 2001 at 19:34 UTC ( [id://72364]=note: print w/replies, xml ) Need Help??


in reply to (tye)Re: Scalars, Lists, and Arrays
in thread Scalars, Lists, and Arrays

The Perl documentation has two different things that both end up being casually called "list": "list values" and "list literals". A "list literal" is that comma-ish thing that turns into the comma operator in a scalar context (last value wins). A "list value" is the result from executing an operator in a list context. And yes, a list literal yields a list value in a list context, hence leading to the casual use of "list" for both.

In an ideal world, all naked "list" mentions would be expanded to either "list value" or "list literal" as appropriate. But most people generally figure it out by context (gah!) anyway.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
(tye)Re3: Scalars, Lists, and Arrays
by tye (Sage) on Apr 13, 2001 at 20:39 UTC

    One of the other threads I mentioned (tr doesn't *really* use a list), as you can tell from the title, shows how "list" is used in the Perl documentation to talk about at least one more thing than the two that you list. This appears to have caused at least a little confusion.

    I'd list all of the ways that "list" is used within the Perl documentation, but the thought of compiling such a list makes me listless. ;)

    I think that being able to talk about a "list" within a given documentation context is helpful in making the documentation easy to read. So no, I don't think changing "list" to "list literal" or "list value" everywhere would be an improvement.

    There are some places in the documentation that could be made more clear by being explicit about what is meant by "list" in that section.

    But I think the important thing is to get people to realize that they have to figure out what is meant by "list" in each context. And that is what I am trying to do.

            - tye (but my friends call me "Tye")

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://72364]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-03-29 06:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found