Re: [PHP-DEV] PHP 5.1 - operator overloading

2005-02-07 Thread Terje Slettebø
(Ditto remark here as the posting I just sent: Please direct any followup privately) >From: "Stanislav Malyshev" <[EMAIL PROTECTED]> > TS>>An advantage of function objects in C++ is that they can be used where > TS>>functions are expected. Nevertheless, there are some features that can be > > Dep

Re: [PHP-DEV] PHP 5.1 - operator overloading

2005-02-07 Thread Terje Slettebø
>From: "Stanislav Malyshev" <[EMAIL PROTECTED]> > TS>>No, you don't have to go that far. For starters, one could allow function > TS>>(and possibly operator) overloading, based on type hints. The following is > TS>>legal PHP5: > > That will already open the can of worms. And make each function cal

Re: [PHP-DEV] PHP 5.1 - operator overloading

2005-02-06 Thread Stanislav Malyshev
TS>>An advantage of function objects in C++ is that they can be used where TS>>functions are expected. Nevertheless, there are some features that can be Depending on what you mean of "expected". You can't use such object as a function pointer, for example. Yes, you can write Object() and make tha

Re: [PHP-DEV] PHP 5.1 - operator overloading

2005-02-06 Thread Stanislav Malyshev
TS>>No, you don't have to go that far. For starters, one could allow function TS>>(and possibly operator) overloading, based on type hints. The following is TS>>legal PHP5: That will already open the can of worms. And make each function call to go through all the hoops of signature matching. TS

Re: [PHP-DEV] PHP 5.1 - operator overloading

2005-02-03 Thread Wez Furlong
+1. Nothing to see here, move along. On Thu, 03 Feb 2005 18:01:37 -0800, Andi Gutmans <[EMAIL PROTECTED]> wrote: > Guys, > > This thread is cluttering the list. > This won't be implemented, we discussed it in the past and already reached > that decision, pretty much all of the PHP dev team agree

Re: [PHP-DEV] PHP 5.1 - operator overloading

2005-02-03 Thread Andi Gutmans
Guys, This thread is cluttering the list. This won't be implemented, we discussed it in the past and already reached that decision, pretty much all of the PHP dev team agree so I suggest to drop it and let's focus on stuff which will go into PHP... Sorry to be so abrupt but this thread is getting

Re: [PHP-DEV] PHP 5.1 - operator overloading

2005-02-03 Thread Terje Slettebø
> From: "Stanislav Malyshev" <[EMAIL PROTECTED]> > TS>>When you say "typeless", i think you mean "not statically typed". > > Not only, but in this case it is the main trait I meant. ...Because PHP has types, so I felt it was a misnomer to call it "typeless". > TS>>through this discussion elsewhe

Re: [PHP-DEV] PHP 5.1 - operator overloading

2005-02-03 Thread Stanislav Malyshev
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

Re: [PHP-DEV] PHP 5.1 - operator overloading

2005-02-03 Thread Stanislav Malyshev
JT>>> Why would it be ok there, but not in PHP? It also exists in other JT>>scripting > languages, such as Python and Perl. BTW, I don't remember anything useful done with operator overloading on Perl. I must say I wrote a lot of Perl when nothing like Perl 6 existed, so I may be somewhat behind

Re: [PHP-DEV] PHP 5.1 - operator overloading

2005-02-03 Thread Terje Slettebø
> TS>>If $a is an object of a class, then they would both be in the class > TS>>definition. One is called "add", and the other is called "operator+". What's > TS>>the problem with that? > > The problem is that you can't really know what $a is - PHP is typeless. When you say "typeless", i think you

Re: [PHP-DEV] PHP 5.1 - operator overloading

2005-02-03 Thread Stanislav Malyshev
TS>>If $a is an object of a class, then they would both be in the class TS>>definition. One is called "add", and the other is called "operator+". What's TS>>the problem with that? The problem is that you can't really know what $a is - PHP is typeless. You'll have to trace all the program up to $a