Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Yes, that's quite possible. Sigils are clues to the human interpreter as well as the machine interpreter. But what are they clues of? Don't they tell you what you can and cannot do with that piece of data?

In some respect, perhaps sigils represent the contract between Perl and the programmer, just like the rest of Perl grammar.

Perl does have a rich syntax. Would it be richer if you could operate on scalars in ways you can't currently? Or is the operation set not orthogonal enough -- is this a lose because of context ambiguity? That's sort of what I'm working through.

substr() exists. Every C-based language gets it for free. But I think the reason Perl doesn't have strcat() is because the dot-operator is better. In other words, subroutines lose if there's a better metaphor (for some value of "better").

So, assuming Perl6 makes @foo[4] the proper way to index lists, why can't we say $foo[4] is the 'shorthand' for substr()? No, no, I'm not submitting an RFC... I'm just asking, "does it make sense?" and "is it better than substr($foo,4,1)"? And then the next step is to ask, if some PMC of the future stores strings as lists, has Perl therefore gained quite a bit of power while, at the same time, streamlined its interior logic?

I'm working through these thoughts. I don't know the answer.

In reply to Re^2: Representing all data as Lists by rje
in thread Representing all data as Lists (Perl7?) by rje

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 surveying the Monastery: (8)
As of 2024-04-23 14:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found