Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Apocalypse 12

by Abigail-II (Bishop)
on Apr 19, 2004 at 08:09 UTC ( #346221=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Re: Apocalypse 12
in thread Apocalypse 12

This scares me enough to always put parens around function calls
You know what's really scary? Depending on how you place your parens, that might not save you. Say you want to call a method (does the new rule count for subroutine calls as well?) which takes an argument, and add 1 to the result. Just like in Perl5, you use parens:
obj.method ($arg) + 1;
In that case, you might as well have not put the parens there - it's equivalent to:
obj.method ($arg + 1);
If you want to be save, and not depend on unnatural (unnatural in the sense that all major programming languages I know don't have their expressions change meaning depending whether there's a space before an opening paren or not) whitespace rules you have to use an extra set of parens:
(obj.method ($arg)) + 1;

Abigail


Comment on Re: Apocalypse 12
Select or Download Code
Re: Re: Apocalypse 12
by TimToady (Parson) on Apr 20, 2004 at 02:03 UTC
    There is no point in designing your own language if you aren't going to do a few things different from everyone else. You can carp all you like, but this is one thing I choose to do differently.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (17)
As of 2014-12-18 18:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (59 votes), past polls