Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21910 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14058 invoked by uid 1010); 18 Feb 2006 01:02:18 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 14043 invoked from network); 18 Feb 2006 01:02:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Feb 2006 01:02:18 -0000 X-Host-Fingerprint: 81.169.182.136 ajaxatwork.net Linux 2.4/2.6 Received: from ([81.169.182.136:39228] helo=strato.aixcept.de) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id D6/92-26540-91276F34 for ; Fri, 17 Feb 2006 20:02:18 -0500 Received: from [192.168.1.3] (dslb-084-063-013-081.pools.arcor-ip.net [84.63.13.81]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by strato.aixcept.de (Postfix) with ESMTP id 8F9CB35C1DD; Sat, 18 Feb 2006 02:02:13 +0100 (CET) Date: Sat, 18 Feb 2006 02:02:16 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <535016514.20060218020216@marcus-boerger.de> To: Zeev Suraski , Sara Golemon Cc: internals@lists.php.net In-Reply-To: <7.0.1.0.2.20060218020210.086c8ec0@zend.com> References: <002201c6331d$a79473b0$58d01a44@stumpy> <7.0.1.0.2.20060216192615.099c9598@zend.com> <000901c63322$20b5d550$5c8be5a9@ohr.berkeley.edu> <7.0.1.0.2.20060217005156.0b12d660@zend.com> <4858f9d90602170155v6843bb5ew@mail.gmail.com> <7.0.1.0.2.20060217130522.083f7c40@zend.com> <796153012.20060218002455@marcus-boerger.de> <7.0.1.0.2.20060218020210.086c8ec0@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: Minor engine patch to facilitate PECL/operator From: helly@php.net (Marcus Boerger) Hello Zeev and hello Sara Saturday, February 18, 2006, 1:04:20 AM, you wrote: > At 01:24 18/02/2006, Marcus Boerger wrote: >>Actually Sara only asked whether she could add a flag to some handlers. >>That has nothing to with anything you started to discuss from there. > Uhm, Sara asked whether she could add a flag to a specific operator > to facilitate a certain behavior, namely, the ability to make x>x be treated differently. It has everything to do with what I > discussed from there (but not with transitivity). the point is not being able to treat them differently. The point is being able to distinguish them so the right operation is called. Btw, in c++ it is common to do things like: bool operator != (_IN Type& oth) { return !(operator == (oth)); } for < and > it means in php the user could (should we add overloading) do function __less_then($other) { return $other->__greater($this); } But before you think i want op overloading in php let me assure you that i do not want that. The reson is that it is the opposite of our beloved KISS approach. So for example sooner or later we'd reach a point where crazy stuff - really crazy stuff - nobody understands is needed. For example another view on C++. Most overloaders do checking for "has some value" or "is valid" by: operator bool () const {... } Which leads to a lot of problems. While the correct version would be: typedef MemberType ClassType::*unspecified_boolean_type; operator ClassType::*unspecified_boolean_type() { return valid ? &ClassType::member : 0; } MemberType member; And now tell me how many ppl do you know who understand the above and the implications the simple bool conversion has. Best regards, Marcus