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

Re: Re: What should be returned in scalar context?

by Juerd (Abbot)
on Dec 02, 2003 at 17:21 UTC ( #311691=note: print w/replies, xml ) Need Help??

in reply to Re: What should be returned in scalar context?
in thread What should be returned in scalar context?

I hate having to write $x = uc $x; when the dwimmiest way would be uc $x; and have it mutate in void context.

The funny (?) thing is that Perl itself is inconsistent when it comes to operators that change strings.
MutatingNot mutating

Juerd # { site => '', plp_site => '', do_not_use => 'spamtrap' }

  • Comment on Re: Re: What should be returned in scalar context?

Replies are listed 'Best First'.
Re: Re: Re: What should be returned in scalar context?
by chromatic (Archbishop) on Dec 03, 2003 at 01:46 UTC

    As of last week, Larry's plan is to make Perl 6 much more consistent in that respect. My speculation (not his official pronouncement) is that there'll be two versions of each operator, one that works in-place and one that returns the modified value, leaving the original untouched.

    It'll probably go further than Ruby's convention of postfixing ! to methods that operate in-place, perhaps having language support for adding this behavior to your own operators.

    It's only in the idea stages, though.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://311691]
[Discipulus]: .. yes erix until NodeReaper put jhon coltrane again
[erix]: nice cover with the spitting image of George (and a great solo by Prince at the end )
[Discipulus]: good night monks! i feel fresh as the turkey in the hoven but i need to sleep
[planetscape]: gobble, gobble, Discipulus!
[erix]: Discipulus: buonanotte! :)
[stonecolddevin]: man we need a new guitar legend
[stonecolddevin]: Clapton has issues playing nowadays
[stonecolddevin]: Prince is gone
[stonecolddevin]: Van Halen is still around but I haven't heard any of their new stuff
[erix]: oh, 41M views -- everyone has seen it already then :)

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2017-06-22 21:18 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (531 votes). Check out past polls.