TS>>When you say "typeless", i think you mean "not statically typed". I've been

Not only, but in this case it is the main trait I meant. 

TS>>through this discussion elsewhere - a variable will at any one time have a
TS>>well-defined type (or unset), which you may overload on, so the language is

That's the whole point - in PHP there's no mechanism you could overload 
function based on the types of their parameters, neither statically nor 
dynamically. To add this thing would be a very major change and will open
galactic-size can of worms (think "implicit conversions", "converting 
constructors", "multiple inheritance", etc.). And this would seriously 
complicate function call logic - which is very bad, because, unlike 
statically-typed language, we can not offload this complexity to one-time 
compile stage.

TS>>Yes, variables are dynamically typed, but when you call a function, you
TS>>typically have an idea of what its type is. Otherwise, the "type hints" for
TS>>PHP 5 would be pointless! By your argument.

Type hints check if the argument passed to function is of the right type. 
They don't make PHP call different functions on different argument types.

TS>>That's right, so we'd really need function overloading to be able to use the
TS>>free function form, which I think is another good idea (function
TS>>overloading).

See above. 

TS>>> - except for select things like
TS>>> complex and matrices (and maybe two more things like this) I don't see any
TS>>> value in having, say, + overloaded. Using good old methods will never fail
TS>>> you.
TS>>
TS>>Neither will assembly code.

What is with that assembly code that you keep mentioning it? Assembly code 
is entirely irrelevant to the discussion, since, as I already explained 
once, difference between assebmly code and higher-level programming 
languages in in complexity incapsulation, while difference between 
operator overloading and using method is purely syntactical - operator 
overloading can be translated one-to-one to method calls without exposing 
any complexity, while translating method call to assemly exposes a lot of 
complexity. 

-- 
Stanislav Malyshev, Zend Products Engineer   
[EMAIL PROTECTED]  http://www.zend.com/ +972-3-6139665 ext.115

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to