Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35592 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67836 invoked by uid 1010); 19 Feb 2008 13:12:19 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 67821 invoked from network); 19 Feb 2008 13:12:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2008 13:12:19 -0000 Authentication-Results: pb1.pair.com smtp.mail=cschneid@cschneid.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=cschneid@cschneid.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cschneid.com from 195.141.85.117 cause and error) X-PHP-List-Original-Sender: cschneid@cschneid.com X-Host-Fingerprint: 195.141.85.117 uf1.search.ch Linux 2.6 Received: from [195.141.85.117] ([195.141.85.117:50231] helo=smtp.rim.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8D/5F-55225-1B5DAB74 for ; Tue, 19 Feb 2008 08:12:18 -0500 Received: from localhost (localhost [127.0.0.1]) by rolig.search.ch (Postfix) with ESMTP id 693D3379626 for ; Tue, 19 Feb 2008 14:12:14 +0100 (CET) Received: from smtp.rim.ch ([127.0.0.1]) by localhost (search.ch [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 10522-09 for ; Tue, 19 Feb 2008 14:12:12 +0100 (CET) Received: from [192.168.1.72] (ultrafilter-i [192.168.85.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by rolig.search.ch (Postfix) with ESMTP id 7CEC8379621 for ; Tue, 19 Feb 2008 14:12:12 +0100 (CET) Message-ID: <47BAD5AB.2030404@cschneid.com> Date: Tue, 19 Feb 2008 14:12:11 +0100 User-Agent: Thunderbird 1.5.0.12 (X11/20060911) MIME-Version: 1.0 To: internals@lists.php.net References: <001c01c87264$3c01b4e0$b4051ea0$@de> <58510.98.193.37.55.1203374232.squirrel@www.l-i-e.com> <200802181936.17739.larry@garfieldtech.com> In-Reply-To: <200802181936.17739.larry@garfieldtech.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at search.ch Subject: Re: [PHP-DEV] RFC: Traits for PHP From: cschneid@cschneid.com (Christian Schneider) Larry Garfield wrote: > On Monday 18 February 2008, Richard Lynch wrote: >> Why not just allow 'include' here instead? >> > Because include requires the code in question to live in another file, which I > don't always want. I'm with Richard Lynch here: Simply allow inclusion. No new language concept, instead an existing one is made more orthogonal which is A Desirable Thing(tm) IMHO. About having it in the same file: You then need to also have the two classes using the Trait to live in the same file (or include_once that file) which is something I'm trying to avoid. I've gotten fond of one class per file for the sake of an autoloader anyway so I don't think separating the common code into a separate file is a big disadvantage. The part about being able to do partial Trait use seems hackish and somewhat complicated to me so I'd rather not have it in the language. It feels a little bit like being able to partially implement an Interface: I think a class should either have a Trait or not. If we're using include to emulate Traits then the same could be accomplished by separating the parts into files (if *really* desired). -1 for Traits as proposed +1 for allowing include in class definitions - Chris