HaloO,
Mark J. Reed wrote:
For any numeric type of $x, $x++ should mean $x += 1.3.14 becomes
4.14. -3.14 becomes -2.14 (which indicates that floor() is not
involved) . 5/8 becomes 13/8. The step size is irrelevant. If $x is
so large that adding 1 gets lost due to the precision, then OK,
HaloO,
Larry Wall wrote:
Well, maybe 0 .. 10-ε or some such.
This ε there is what I have as the .step method of nums
in the thread The Inf type. That is $min..^$max is the
same as $min..($max-$max.step). For Ints the .step is
always 1. For Nums it depends on the number, that is the
spacing of
2008/7/10 TSa [EMAIL PROTECTED]:
HaloO,
Larry Wall wrote:
Well, maybe 0 .. 10-ε or some such.
This ε there is what I have as the .step method of nums
in the thread The Inf type. That is $min..^$max is the
same as $min..($max-$max.step). For Ints the .step is
always 1. For Nums it depends
2008/7/10 TSa [EMAIL PROTECTED]:
So, does it make sense to define ++ and -- for nums as
$x++ meaning $x += $x.step?
No.
Or should these operators floor the value to an Int and step the result?
No.
For any numeric type of $x, $x++ should mean $x += 1.3.14 becomes
4.14. -3.14 becomes
Mark J. Reed wrote:
All of this is IMESHO, of course, but I feel rather strongly on this
issue. ++ means += 1 .
Agreed. Anything else violates the principle of least surprise.
Mind you, this is only true for numerics, where the concept of 1
potentially has meaning. For non-numerics,
On Thu, Jul 10, 2008 at 12:45 PM, Jon Lang [EMAIL PROTECTED] wrote:
So if '++' works on strings, it might be reasonable to have bob++ == boc.
I was assuming that would continue to be true, as it is currently in
Perl5, Pugs, and Rakudo.
(Well, technically bob++ is an error, but { my $x = bob;