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

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.

  • Comment on (bbfu) (DWIM scalars) Re4: Perl6 headaches?

Replies are listed 'Best First'.
Re: (bbfu) (DWIM scalars) Re4: Perl6 headaches?
by kwoff (Friar) on Nov 05, 2001 at 20:35 UTC
    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.