Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: Re: Re: Re: Isn't that nice?

by ichimunki (Priest)
on Aug 30, 2002 at 21:03 UTC ( #194253=note: print w/ replies, xml ) Need Help??

in reply to Re: Re: Re: Isn't that nice?
in thread Isn't that nice?

Is that really going to be in Perl 6 like that?

How is that an improvement over sub half { divide($_[0]/2) }; ? Especially when you consider that to write sub half assuming... as shown you have (apparently) to know that divide has a $y to which to assign 2.

Comment on Re: Re: Re: Re: Isn't that nice?
Select or Download Code
Re: Isn't that nice?
by jepri (Parson) on Aug 31, 2002 at 04:34 UTC
    You can create functions with defaults. I don't know about you, but that's an instant winner for me. And you can reduce temporary variables by setting up a function in stages, perhaps by asking the user for the parameters one by one, and then it fires when you have them all filled in. Saves temporary variables and looks neater. Of course you don't need to use this - you can keep writing temporary variables if you really want.

    As I understand it, this is another effect of the much repeated 'closures are first class objects'.

    I didn't believe in evil until I dated it.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (15)
As of 2014-09-02 20:15 GMT
Find Nodes?
    Voting Booth?

    My favorite cookbook is:

    Results (29 votes), past polls