Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^6: What's wrong with Perl 6?

by Cap'n Steve (Friar)
on May 14, 2007 at 23:33 UTC ( #615436=note: print w/replies, xml ) Need Help??


in reply to Re^5: What's wrong with Perl 6?
in thread What's wrong with Perl 6?

Well, I guess we have different definitions of "Perlish". I was thinking "similar to past versions of Perl" and you seem to be thinking "conforms to the Perl philosophy". With your example of .say for =$fh;, once again the only thing that I would call Perlish about that is the dollar sign, and if you changed the variable name I'd have no clue what it does.

Replies are listed 'Best First'.
Re^7: What's wrong with Perl 6?
by blazar (Canon) on May 15, 2007 at 10:11 UTC
    Well, I guess we have different definitions of "Perlish". I was thinking "similar to past versions of Perl" and you seem to be thinking "conforms to the Perl philosophy".

    ++ because even if I disagree, you raised some important points. Indeed I was replying much along the lines of what TimToady explained earlier in this thread. Not because I took that as a revelation (although I find it to be so instructive and pleasantly written as usual) but because I'm already much thinking/feeling that way.

    With your example of .say for =$fh;, once again the only thing that I would call Perlish about that is the dollar sign, and if you changed the variable name I'd have no clue what it does.

    Well, then the semicolon appears to be statement delimiter too! ;-) But seriously, there's at least another very perlish thingy: the for statement modifier. This is just the same as Perl 5's. The real difference being that although both in 5 and 6 TMTOWTDI it's also true that in both there's often a preferred WTDI for most common situations, and in Perl 5 we often recommend to use a while loop to iterate over a filehandle unless there's a good reason to slurp the whole file in at a time. This has been occasionally source of confusion. But Perl 6 goes one step further making the whole thing more consistent thanks to its lazy evaluation model, so that for is suitable to iterate over any iterator. Said this, if you compare <$fh> and =$fh, you will notice that the former you're familiar with. The second, not. But if you knew neither, they would be equally strange, perhaps but the fact that the = sign is also used for more familiar things, like assignment; OTOH as $Larry says, the unary one also visually conveys the idea of lines from a file and thus does make sense. Last, say() is something that semantically has been missing in Perl for a long time, but then its name strongly suggests what it does. I'm not commenting on the dot and in particular the unary one, which is... well not much pre-6'ish, but is indeed very perlish in the sense above.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2021-01-17 01:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?