Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Yes, it's easy to have a great deal of affection for the current syntax. It seemed like a good idea at the time, and still works pretty well in the context of the rest of Perl 5. But to some extent you have to take it on faith that we didn't change anything without at least the semblance of a good reason, and many of these reasons make more sense in the context of Perl 6 as a whole. I can attempt to explain some of those decisions here, but I can't rejustify every decision, or I'd end up copying all the Apocalypses, Exegeses, Synopses into Perl Monks, not to mention replicating a great number of design meetings, phone logs, irc chats, etc. And as chromatic points out, we'd never get any work done if we tried to answer every question multiple times.

However, I have some hope that this thread will have sufficient cultural leverage to make a difference, so I'm responding here. On your particular points:

for =$fh - that just looks string. I think while(<$fh>) is too strong of idiom to break
Brackets are in extremely short supply in ASCII, and the angle brackets were rather wasted on a single operator. Plus we really needed to do something about the strange autoquoting rules in subscripts that result in far too many FAQs. Stealing angles for both qw// and literal subscripts solved those problems, but it meant that we needed something else to iterate iterators. And unary = is the best we've come up with so far, given all the other demands on the character set. It has some visual mnemonic value in that it looks kinda like two lines from a file. But yes, it's a little strange.
~ ~ for string concats
We needed something for that operator, and dot was no longer going to be available. We can't use juxtaposition like awk because that screws up expectations of terms vs operators, a fundamental contextual idea that carries through all the way from Perl 1 to Perl 6. We originally specced _ for it, but it didn't work well next to identifiers, and we wanted to reserve the underscore identifier for other potential uses, so we settled on ~ because it looks like a bit of string, and because the bitwise uses of tilde were going away in favor of a de-Huffmanized but more regular set of bit operators, so tilde was available.
??!! replacing ? :
This is another case where some very important keys on the keyboard are locked up in not-so-very important operator, so we decided to de-Huffmanize and rationalize them. (The use of a bare colon was particularly difficult because there were so many other proposed uses for colon that we were trying to accomodate.)

The character doubling fits in culturally with the other short-circuiting forms such as && and ||. At one point the else was indicated by a double colon, but that turned out to be visually ambiguous with package name delimiters, plus we have a fairly consistent usage of ? to mean true and ! to mean false through the rest of the language.

Anyway, you undoubtedly like the current Perl 5 idioms for the same reasons that I liked them originally. :-) I would like to believe that you'll end up liking the Perl 6 idioms too, once you get used to them.


In reply to Re^2: What's wrong with Perl 6? by TimToady
in thread What's wrong with Perl 6? by duff

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 making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2024-04-19 13:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found