Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^5: Perl 6 implementation of the following Perl 5 code

by moritz (Cardinal)
on May 27, 2013 at 15:32 UTC ( #1035430=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Perl 6 implementation of the following Perl 5 code
in thread Perl 6 implementation of the following Perl 5 code

Fwiw the removal of condition parens isn't related to unspace at all. Rather it's related to the fact that if you allow whitespace around the method call operator, you can't infix operators beginning with a dot (for example the range operator .. comes to mind).

In Perl 5 this is less of an issue because the method call operator is longer, so not having any infix operators beginning with -> isn't a big loss.

Finally Perl 6 allows you to write .method as a shorthand for $_.method, and if we allow a blank before the dot, it's hard to distinguish a method call on the previous term from a method call on $_.

That said, such long chains of method calls tend to be rare in code I write, so the unspace really isn't such a big issue in practice.


Comment on Re^5: Perl 6 implementation of the following Perl 5 code
Select or Download Code
Re^6: Perl 6 implementation of the following Perl 5 code
by chromatic (Archbishop) on May 27, 2013 at 15:48 UTC
    ... such long chains of method calls tend to be rare in code I write...

    In code you write, perhaps.

    ... to distinguish a method call on the previous term from a method call on $_.

    How often does someone expect to chain methods and call a method on $_? Seems to me if you want to change the invocant from whatever the previous expression returned, you ought to make that method explicit, whether by typing it out by hand or terminating the entire statement so that it's not ambiguous at all.

Re^6: Perl 6 implementation of the following Perl 5 code
by Jenda (Abbot) on May 27, 2013 at 21:07 UTC

    Such long chains of methods tend to be common in code I write. The more I know about Perl 6, the less I care it's not in a usable state yet. This is yet another of the decisions that make Perl 6 cryptic and unreadable.

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2014-09-19 06:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (132 votes), past polls