in reply to Re^3: getting rid of special features
in thread getting rid of costly special features
Incrementing numeric indices happens maybe 1_000 or even 1_000_000 times more often than incrementing strings. So for integers this operator has to be short.
But the effort to learn and maintain string_increment with a core operator like ++ is far less economic.
For that reason I agree that strinc() (or whatever notation suits the most) would pollute the namespace like in PHP, so it should be outsourced to a pragma or module.
The inverse approach would be the 'no feature qwinc' I proposed, forcing ++ to croak on strings and allowing full backwards compatibility.
Furthermore allowing optimizations within Perl and less headaches and far more performance when translating to other VMs.
Cheers Rolf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: getting rid of special features
by Anonymous Monk on Feb 17, 2013 at 23:37 UTC |