Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35760 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58534 invoked by uid 1010); 23 Feb 2008 19:44:51 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 58519 invoked from network); 23 Feb 2008 19:44:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Feb 2008 19:44:51 -0000 Authentication-Results: pb1.pair.com header.from=php@stefan-marr.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php@stefan-marr.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain stefan-marr.de from 82.96.83.42 cause and error) X-PHP-List-Original-Sender: php@stefan-marr.de X-Host-Fingerprint: 82.96.83.42 serv6.servweb.de Linux 2.4/2.6 Received: from [82.96.83.42] ([82.96.83.42:46941] helo=serv6.servweb.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C8/90-30812-2B770C74 for ; Sat, 23 Feb 2008 14:44:51 -0500 Received: from [192.168.0.25] (toolslave.net [85.88.12.247]) by serv6.servweb.de (Postfix) with ESMTP id A01055903DA; Sat, 23 Feb 2008 20:46:21 +0100 (CET) Message-ID: <47C077B6.4090503@stefan-marr.de> Date: Sat, 23 Feb 2008 20:44:54 +0100 Reply-To: php@stefan-marr.de User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Steph Fox Cc: "D. Dante Lorenso" , Internals Mailing List References: <001c01c87264$3c01b4e0$b4051ea0$@de> <698DE66518E7CA45812BD18E807866CE014A8D9D@us-ex1.zend.net> <47BE0664.8060304@stefan-marr.de> <47BE0A09.6060702@lorenso.com> <47BE0CC4.1090202@stefan-marr.de> <005e01c874f1$8e139ed0$c6fc1f3e@foxbox> In-Reply-To: <005e01c874f1$8e139ed0$c6fc1f3e@foxbox> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Redirected: By TestProxy Subject: Re: [PHP-DEV] Re: Traits for PHP ... Why can't every Class be a Trait? From: php@stefan-marr.de (Stefan Marr) Hi, Steph Fox schrieb: > All I'm seeing here is people with CS degrees saying trait would be > cool. What about us peasants? Or am I the last living peasant? :\ > That's possible, I suppose. > > Sell it to me? A very cool thing of traits is the flattening property ensuring that there is no difference between a method from a trait imported to the class and a method defined in the class. Ok, there are people trying to mess up the notion proposed by additional complexity. But based on the original proposal made by me, traits can be seen as a language supported copy'n'past mechanism, like some complex macro copying the traits methods to a class body (with those excluding and aliasing features added). In the implementation for the Squeak Smalltalk language, they have introduced a modified class browser. The class browser is the embedded IDE of the Smalltalk guys, with similar features as the outline view of eclipse. To avoid the need for developers to struggle with traits if they don't know about or do not like them, they build a class browser which only shows the flattened view on the classes, including all methods from traits but avoiding to annoy the developers with the trait notion. This is possible to be implemented in the Eclipse PDT, too. Some Java guys have already demonstrated a comparable implementation for the Java part of IDE to demonstrate traits for Java. In my opinion, traits is a thing developers has only to be aware of if they really did like to use them. (iff proper tool support is available. Guess it wouldn't be that way for VIM users, for example) Kind Regards Stefan