Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45818 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49538 invoked from network); 15 Oct 2009 06:00:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Oct 2009 06:00:25 -0000 Authentication-Results: pb1.pair.com smtp.mail=crocodile2u@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=crocodile2u@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.225 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: crocodile2u@gmail.com X-Host-Fingerprint: 209.85.220.225 mail-fx0-f225.google.com Received: from [209.85.220.225] ([209.85.220.225:49717] helo=mail-fx0-f225.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D9/D2-31817-77AB6DA4 for ; Thu, 15 Oct 2009 02:00:24 -0400 Received: by fxm25 with SMTP id 25so718385fxm.24 for ; Wed, 14 Oct 2009 23:00:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=9kA24e/dsSZ4Nr3APkYBWeifEINxO+G7nivAgLlww5Q=; b=Ji+oWQgeNqQZaG687zd6MrG0RbOerZuagwH6VDuket+ipA9cMYzcc7r40BgU/IWnjl Amyx7LdHSrw9FC69nzzGVUO1IDC+ZSa6frrOVb42+44YEA3jr74BF9rpP0SqmRzVOUcq iv11OneOzDCxE/C/cIbihQoi0XkSSGWFGS5xk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=N9cpcg9cOKmP/vxQ7wygv58TU9ZK1iHXHWvCwZxq2YQ7RtXudYWs6vIRjtcb3ATTJS TOKb2B9+5Tzvtk6ong9zNZWydrWPQcsS//739ODQJUAatV7clzzshfZKNmpicNmU/cST gxFwSc+zv5Oj7jpsGHClPzt2Uo5DmVedajFrE= MIME-Version: 1.0 Received: by 10.103.86.22 with SMTP id o22mr4044084mul.102.1255586421041; Wed, 14 Oct 2009 23:00:21 -0700 (PDT) In-Reply-To: References: <002b01c92d67$ae92fdc0$0bb8f940$@de> <9D1CD88B-3A75-453C-9515-5F31E60F90AC@pooteeweet.org> <90CF2907-8C30-4EB0-9AC5-AD00EFC14023@stefan-marr.de> <4AD62E77.9010802@zend.com> <3530BC53-F4D6-48EC-BBEB-54E79AD497C3@pooteeweet.org> Date: Thu, 15 Oct 2009 10:00:20 +0400 Message-ID: To: Tom Boutell Cc: Lukas Kahwe Smith , Stanislav Malyshev , Stefan Marr , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Request for Comments: Horizontal Reuse for PHP From: crocodile2u@gmail.com (Victor Bolshov) Personally, I don't get deep into how PHP works inside, I'm just a PHP-programmer (the man from userland). For me it will surely be better to use 'insteadof', not 'instead'. And It seems to me more natural to use the following syntax when using grafts: class Foo { use MyGraft { public graftedClassMethodBar() as bar(); } } $foo = new Foo(); $foo->bar(); 2009/10/15 Tom Boutell : > I'm very concerned about the practical consequences of introducing > traits without state. > > Lacking support for properties (state) in traits, programmers will > immediately start hacking properties in anyway. > > I see two approaches: > > A. They could do this using static hashes in global variables or a > separate class. The result is a garbage collection failure as these > references to $this will never go away. Designed-in GC failures are > unacceptable post PHP 5.3. > > B. PHP allows you to define properties at runtime. That is, you can write: > > $this->title = 'my title'; > > Without declaring var $title; at the class level. > > But PHP 6 seems to be moving toward more strictness, not less, and > this style encourages the use of undeclared variables with the > resulting potential for missed bugs. > > * * * > > Also, the 'instead' keyword is baffling - it could mean replace A with > B or replace B with A depending on how you place your mental comma - I > much prefer the assignment syntax alternative, or 'insteadof' which is > unambiguous. > > On Wed, Oct 14, 2009 at 4:07 PM, Lukas Kahwe Smith wrote: >> >> On 14.10.2009, at 22:03, Stanislav Malyshev wrote: >> >>> Hi! >>> >>>>> So lets warm this up again. >>>>> HEAD is for development .. so lets get this into HEAD so that it will be >>>>> part of the next bigger PHP release for sure! >>>> >>>> Well, the code is sitting here >>>> http://github.com/gron/php-src/tree/PHP_6-traits >>>> and waits to be merged. :) >>> >>> I thought before merging code it would be useful to have some discussion >>> on if the code is actually doing what we want. If it's based on >>> http://wiki.php.net/rfc/horizontalreuse then for example I can see some >>> potential issues for bytecode caching related to renaming and changing >>> visibility. >>> Also, it is not clear that we want grafts there at all, some aspects of >>> them seem to get too hairy, esp. $this issue or statics. >>> >> >> i think Stefan is fully aware of that probably there will be a discussion >> first .. >> but i think we all agree that this feature is very high on the list of what >> people want and therefore i wanted to get this discussion going, so that >> after its concluded traits can be commited to HEAD. >> >> regards, >> Lukas Kahwe Smith >> mls@pooteeweet.org >> >> >> >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > > > -- > Tom Boutell > P'unk Avenue > 215 755 1330 > punkave.com > window.punkave.com > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Victor