On Mon, May 17, 2004 at 01:42:26PM -0700, chromatic wrote:
> On Mon, 2004-05-17 at 13:35, Pedro Larroy wrote:
>
> > Would it be a good idea to make ==, and other numeric comparators polymorphic
> > so they can be used also for string comparisons?
>
> How does the compiler know which is which?
>
> Is "10" a string? Is it a number? Is "10base-T" a string? Is it a
> number? Is an object with overloaded stringification and numification a
> number? Is it a string?
>
> I don't know a good heuristic for solving these problems. If you have
> one, it's worth considering though.
>
> -- c
>
I thought perl internally would know. At least in perl5 it has to know
somehow, since you can $var++ when is numeric and also when it's a
string, and behaves different in each case.
Regards.
--
Pedro Larroy Tovar | Linux & Network consultant | piotr%member.fsf.org
Software patents are a threat to innovation in Europe please check:
http://www.eurolinux.org/