Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35727 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94414 invoked by uid 1010); 22 Feb 2008 14:45:22 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 94399 invoked from network); 22 Feb 2008 14:45:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Feb 2008 14:45:22 -0000 Authentication-Results: pb1.pair.com header.from=greg@chiaraquartet.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=greg@chiaraquartet.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain chiaraquartet.net from 38.99.98.18 cause and error) X-PHP-List-Original-Sender: greg@chiaraquartet.net X-Host-Fingerprint: 38.99.98.18 beast.bluga.net Linux 2.6 Received: from [38.99.98.18] ([38.99.98.18:41845] helo=mail.bluga.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FA/FA-22931-EFFDEB74 for ; Fri, 22 Feb 2008 09:45:20 -0500 Received: from mail.bluga.net (localhost.localdomain [127.0.0.1]) by mail.bluga.net (Postfix) with ESMTP id 675B1C10268; Fri, 22 Feb 2008 07:45:16 -0700 (MST) Received: from [192.168.0.106] (CPE-76-84-4-101.neb.res.rr.com [76.84.4.101]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bluga.net (Postfix) with ESMTP id E5E53C10267; Fri, 22 Feb 2008 07:45:14 -0700 (MST) Message-ID: <47BEE001.9080602@chiaraquartet.net> Date: Fri, 22 Feb 2008 08:45:21 -0600 User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Marcus Boerger CC: Lukas Kahwe Smith , php@stefan-marr.de, Evert|Rooftop , Stanislav Malyshev , internals@lists.php.net References: <001c01c87264$3c01b4e0$b4051ea0$@de> <173732199.20080219175837@marcus-boerger.de> <1203452909.24580.9.camel@localhost> <1e12984d0802191323o710c6b8ej3a54af7901cf35f1@mail.gmail.com> <47BB4AC9.9070701@zend.com> <1e12984d0802191346x7c145d7fp14c01ec4e5993779@mail.gmail.com> <47BB4F49.1030904@rooftopsolutions.nl> <1e12984d0802191359p4f21c3acrdff4b86adfb4bf3@mail.gmail.com> <1495054633.20080220205951@marcus-boerger.de> <1e12984d0802201243gfa51f01i311891e8965ed51e@mail.gmail.com> <9EE7F229-0710-48E8-9A26-DC8031AF8979@pooteeweet.org> <1985981545.20080222134413@marcus-boerger.de> In-Reply-To: <1985981545.20080222134413@marcus-boerger.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: Re: [PHP-DEV] RFC: Traits for PHP From: greg@chiaraquartet.net (Gregory Beaver) Marcus Boerger wrote: > Hello Lukas, > > alright, > > 'foo as bar' is ok to me and does not even add a new keyword. > Ignore or any more keywords are bad and I also think that the correct > would be hide(ing). But as I further more explained it should really be > something that only marks a method as private if at all. That can be > done as: > 'foo as private' since private is a keyword it cannot conflice anyway. I like this solution. I have been uncomfortable with the current trait suggestions because they occur in the body of the class, whereas extends/implements is outside. I think there is a way to handle this, however. class Blah extends ... implements ... traits trait1, trait2, trait3 { } The above presents a problem if trait2 contains conflicting method names, but a simple way to solve it would be to automatically alias methods by prepending traitname:: would create method "trait2::a" and we can alias it in the class body. Also, $a->{'trait2::a'}(); is legal syntax, so no problems there. Example: This would be 100% obvious to me, and far clearer for reading since we would be explicitly saying we're aliasing a function. So, I rescind my previous syntax suggestion in favor of the above. Greg