I don't know if this has already been discussed, or is out of the question,
but I wonder since perl does not currently differentiate between numbers and
string, and when it does, it does so very inconsistantly, is there be any
hope for any changes/modificatins for Perl 6.

Many can argue that this is not needed, and in most cases they are right.
Though I ran into a problem today, trying to push values into an array.  The
indexes are then evaluated by their content.  When using push, the number
seems to always be pushed in the string format, as dumped by Data::Dumper.

I then tried these variations

$num = 7;
push(@array, $num)
push(@array, $num+0)
push(@array, sprintf("%d", $num);

and a few other, to get the same result, but when using

push(@array, int($num))

though not what I needed, since the number might be a decimal, it pushed a
numeric value into @array (unquoted by Data::Dumper).

Evidentally there is some differentiation and maybe adding number() method
would do, but I wonder if there is more internal work to be done.

Ilya

Reply via email to