i'll try to answer both Marcus and Wez here:

> Where is the big difference (first is postfix syntax, second is prefix syntax).

the difference is between whether you have to change *lots* of existing code
or do exactly *one* cast in new code while you write it:

$timer = (Timer) $MI_obj;

library_call_1 ($timer);
library_call_2 ($timer);
library_call_3 ($timer);

etc...

what i am proposing here is that the cast would "stick" when object
references are passed around or assigned to. the reference $var would
implicitly "remember" the class it has been cast up to. reasonable enough?

> And as we have no typesystem we cannot use typecasting but another solution.

no typesystem huh? we do have classes, right? so we do have a
typesystem, and just because a variable's type is hidden from the
programmer most of the time doesn't mean it isn't there. btw, PHP
already has the (new_type)$var cast syntax - you can do $var = (int)$var
for example. so we wouldn't really be adding a new construct, but rather
extending an existing one.

so, Wez - why would you want to introduce yet another
cast operator - the "as" keyword? while PHP already has
adopted the C-style (new_type)... operator?

lauri



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

Reply via email to