Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:90345 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99249 invoked from network); 8 Jan 2016 05:14:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Jan 2016 05:14:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=derokorian@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=derokorian@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.46 as permitted sender) X-PHP-List-Original-Sender: derokorian@gmail.com X-Host-Fingerprint: 74.125.82.46 mail-wm0-f46.google.com Received: from [74.125.82.46] ([74.125.82.46:37513] helo=mail-wm0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2B/C7-55593-7A54F865 for ; Fri, 08 Jan 2016 00:14:17 -0500 Received: by mail-wm0-f46.google.com with SMTP id f206so154621109wmf.0 for ; Thu, 07 Jan 2016 21:14:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=NWlBpdP6ZVzYPQrBEZRm0P/OF6nt+uB3fP560K7Ifps=; b=z8E2FNNYzusshN4UFzmRO2gJfz6lSjDOWoeoh5gLryNCP7Z9EWSKr3Fjoug3z+nIv1 QP3dez8GdXvuJ1B+PRChtCAXjjVYyfBB56Or5Q7DV1MmhnAZ4xJTCKS7R4k1Z7A1i74O uJF6O1EgSYvZ3UZWEMH6XLBVsd4wq4R1ANWDPkmAviQpk+zQOyXvqQECmGANpdPC7/M9 H+gIM0JeCZlOUZjteOhJ37CLC/JLrTdw/swhLOA/YB/vmFpsgweKK+jR4EASat7fpoho JnNkh0F1QVeP7DmqiEKYPV8iqiiFcrygyN6x6cFJ0nLdxVndDjRkb8lFVHrNAMKn0EWT WkCA== MIME-Version: 1.0 X-Received: by 10.194.216.100 with SMTP id op4mr98803875wjc.85.1452230052707; Thu, 07 Jan 2016 21:14:12 -0800 (PST) Received: by 10.28.98.133 with HTTP; Thu, 7 Jan 2016 21:14:12 -0800 (PST) In-Reply-To: <568F0FB8.9030807@dasprids.de> References: <5605BACE.30803@gmail.com> <5605C23D.6030104@gmail.com> <56065071.2070107@gmail.com> <568F0FB8.9030807@dasprids.de> Date: Thu, 7 Jan 2016 22:14:12 -0700 Message-ID: To: "Ben Scholzen 'DASPRiD'" Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e014935f46c84e60528cba8cb Subject: Re: [PHP-DEV] Implementing Generics, and none scalar default properties. From: derokorian@gmail.com (Ryan Pallas) --089e014935f46c84e60528cba8cb Content-Type: text/plain; charset=UTF-8 Hi Ben and Rasmus, On Thu, Jan 7, 2016 at 6:24 PM, Ben Scholzen 'DASPRiD' wrote: > By the way, Rasmus updated the RFC quite a bit, you guys may want to take > a look at it again. > > I just have a couple questions about the rfc, but overall I think its great and I really hope it makes it into PHP! Note that the choice of the keyword is to indicate upper bounds is based on > the rejection of perhaps more obvious alternatives - repurposing the > extends or implements keywords would be misleading, since they would work > precisely the same way; worse, permitting both keywords would render > consumer code invalid if an upper bound type provided by a library is > refactored between class and interface. Repurposing instanceof would also > be misleading, since the upper bound is checking the type-hint, not an > instance. > Why not use "as" which is already the keyword used to define aliases? Probably of the form class foo I think this feels more natural, as its how we do aliasing with a use statement. Also, this way it follows the same style as other aliases "RealName as Alias". I'm not saying is doesn't work, but I wonder if you'd considered as and if so, why you decided against it. When autoloading is triggered e.g. by a new statement with a generic type, > autoloading is triggered as normal, with only the class-name (without type > parameters) being supplied. > In other words, a statement like new Map() will trigger > auto-loading of class Map. What order are things autoloaded (or does it even matter)? For example, given the following - does it matter what order things are autoloaded? It feels like it would but I'm not sure what would get resolved first: class Gen {} class ListGenerator implements HtmlGenerator {} class FtpWriter extends FileIO {} new Gen(123, new ListGenerator(), new FtpWriter()); Again, I'm not sure if it matters but would there be any problems (and this goes to the whole list, since your RFC says you're not a C coder) with the order of autoloading with relation to resolving validity of types? In your second example in the Trait section you have: > class Box > { > use Box; > } I think you meant to say "use Container;" as that is the name of your trait. Again, really awesome RFC and I hope it can be implemented and accepted! ~Ryan --089e014935f46c84e60528cba8cb--