Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Re: Re: Perl6 headaches?

by kwoff (Friar)
on Nov 05, 2001 at 04:50 UTC ( [id://123246]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Perl6 headaches?
in thread Perl6 headaches?

Overloading '+', like Java does in its String class wouldn't work -- not with magical DWIM scalars.

Personally, I was more disappointed with using '_' instead of '+' than I was with using '.' instead of '->'. (FWIW, I don't understand WYM w.r.t. DWIM scalars.)

Replies are listed 'Best First'.
(bbfu) (DWIM scalars) Re4: Perl6 headaches?
by bbfu (Curate) on Nov 05, 2001 at 08:35 UTC

    DWIM scalars: ie, the fact that numeric strings convert themselves to numbers in numeric context, and that numbers convert themselves into strings in string context. Overloading '+' for strings would break this behaviour; and I think pretty much everyone can agree that this is a Bad Thing. :-)

    (Eg, what if you add a numeric string and a number together... Should they be concatenated, or added?)

    bbfu
    Seasons don't fear The Reaper.
    Nor do the wind, the sun, and the rain.
    We can be like they are.

      If we call '+' concatenation a DWIM operator, then I'm not sure that DWIM scalars are necessarily more desirable than DWIM operators. With perl6's ability to declare types (like 'my int i = 6' or something), then maybe there's some other way to work it. I'm not knowledgeable about perl internals, though.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-03-29 00:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found