strong/weak typing and pointers

Steven Bethard steven.bethard at gmail.com
Tue Nov 2 19:26:28 CET 2004


Diez B. Roggisch <deetsNOSPAM <at> web.de> writes:
> 
> I'm not sure how things are implemented internally, but I'd still say my
> definition is correct even for this example: The + operator can be viewed
> as overloaded with the signature
> 
> (float, int) -> float
> 
> But its not for (string, int) - albeit * e.g. is. 

So you would say that in PHP the + operator cannot be viewed as overloaded with
the signature (string, int) -> string?  I don't know PHP, so could you maybe you
could give an example of why you think this is so?

> The question remains if permanent coercions as php (and afaik perl) do can
> also be considered weak typing, as you won't end up with an error for more
> or less anything you do.

Sorry, I don't know what "permanent coercions" means.  Could you explain? 
"Permanent coercions" makes me expect something like:

>>> a = 1.0
>>> b = 1
>>> a + b
2.0
>>> b
1.0

where b's value has been coerced into a float (and reassigned to b) because of
the addition of a.  I'm guessing this isn't what you meant...

Steve





More information about the Python-list mailing list