Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92567 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96942 invoked from network); 20 Apr 2016 19:44:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Apr 2016 19:44:39 -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 209.85.218.44 as permitted sender) X-PHP-List-Original-Sender: derokorian@gmail.com X-Host-Fingerprint: 209.85.218.44 mail-oi0-f44.google.com Received: from [209.85.218.44] ([209.85.218.44:33903] helo=mail-oi0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DA/64-14036-62CD7175 for ; Wed, 20 Apr 2016 15:44:39 -0400 Received: by mail-oi0-f44.google.com with SMTP id k142so52270826oib.1 for ; Wed, 20 Apr 2016 12:44:38 -0700 (PDT) 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; bh=tYuJ5npIvE7Ff3o7GjLBTNdsRQ5wIwPSjXR+Gfnumtg=; b=eQ0jf1fUwFs770T1NqjuERCIDod1p63oBG0H/ri0Awapk8+IwyCPovagzUAZUTfn1i XL4cXoWosByXgl9rfDVBkukJv0NxKQTM8It8GsWTj6QZBJ7t8IKqxtpQQidP8TIF5jSP LstASgpKPyp7QOeJcLcVKi2vju2CQXhotNDrBMz+hQ7lvB8Nf92wzNLFj9p5klvxTe58 4s8JL8CmmeMWtrXQp9A/WmU4G8iArQlFO4OYQx5SRIXhcLDct/BKu8hjFL8+R5Dp/PZM kzvsTiecO6Rg1fiT8f6GF02DwFvGRi+j209JqyuLUhQccE4YBiKGBYn/oGvqqGC9wgQj 9buw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=tYuJ5npIvE7Ff3o7GjLBTNdsRQ5wIwPSjXR+Gfnumtg=; b=mV0ScilYZntpvhxDvgtZ2tPHDCOyJhd5DNyvAyC/yoAHdGxVyY+n2+r1n9dKGHhdr2 AR4mu0ohcJFTDbfLko6mhP31xoOFsRcwNjfu1PBQCCPHwNnn5KK6KErmJdWnssXzQv6d u1ZdsZ+t+wWawHS8NwyO+OkiMhWyBUTbTRo+66cRA5YXcEKCtGeFLZUZOMOqO53lXLCb WhHxAPf0IZpnqwmKjdL3k48brnsL95j574C+P57OarjV9a4oEvCKfDY1dbMYIp1rjZYl y7SWfqTcZVTGMMrGuy+vUB/GwaN0Xqwy1XmDw/hXNcAo93ViFYXWttc2irmPd18Xhu07 Oeog== X-Gm-Message-State: AOPr4FWV2XgcEnm5zLiBjcxLxhY0DSLW8PmVeNf9fFHCBl66LbRzna8RCxoueGEjOdrFxiiv9eqA8AOLSIflDQ== MIME-Version: 1.0 X-Received: by 10.157.16.43 with SMTP id h40mr4487647ote.185.1461181476429; Wed, 20 Apr 2016 12:44:36 -0700 (PDT) Received: by 10.157.41.73 with HTTP; Wed, 20 Apr 2016 12:44:36 -0700 (PDT) In-Reply-To: References: <3cc8a4c7-2640-11ae-a67b-06f909ac1e27@texthtml.net> <57173859.4080501@rochette.cc> Date: Wed, 20 Apr 2016 13:44:36 -0600 Message-ID: To: Dominic Grostate Cc: Guilherme Blanco , Mathieu Rochette , Josh Di Fabio , "Ben Scholzen 'DASPRiD'" , Sara Golemon , PHP internals , Rasmus Schultz , Mathieu Rochette Content-Type: multipart/alternative; boundary=001a1135bf38dae66f0530efd286 Subject: Re: [PHP-DEV] [RFC:generics] From: derokorian@gmail.com (Ryan Pallas) --001a1135bf38dae66f0530efd286 Content-Type: text/plain; charset=UTF-8 On Wed, Apr 20, 2016 at 1:17 PM, Dominic Grostate < codekestrel@googlemail.com> wrote: > Thanks for you're input everyone. > > So far, we have read some ideas for handling upper bounds, or multiple > there of. > The preferred keywords appear to be either "as" or "instanceof". > > class Foo {} > class Foo {} > > We would like to know for sure then if everyone is largely against the > addition of an "is" keyword, in favour of one of the other two. > I like instanceof the most, as I feel its more obvious. "is" is good IMO from a user perspective, tho its a new keyword, its pretty obvious what's happening (my T IS something, and will not be anything else). "as" makes me feel like its going to either type-cast or T is going to be aliased as Bar for later use in the class definition. > ---------------- > > There is also a desire to include unions and intersections. > Presently though, this feature feels tied in with > https://wiki.php.net/rfc/union_types meaning if union types are approved, > then generics would have to support them as well. Likewise if this feature > becomes approved in generics, it would make sense to support them in > regular type hints as well. > Agreed, I think this should be left until after both RFCs have been decided on. > > ---------------- > > The RFC makes a reference to generic closures, which may look something > like this: > > function my_function(callable $func) { > > } > > However, an RFC already exists which is very similar to this feature at > https://wiki.php.net/rfc/callable-types > As it currently standards these RFCs appear incompatible with each other > (please correct me if I am wrong). > > My question about this is would you prefer the generics RFC exclude this > part in favour of a separate or later RFC. > Initially the proposal included generic arrays "array". However to > ease the implementation it was decided that should be a separate feature. > So we'd like to find out if everyone else feels the same way about callable > types. > This makes sense to me to leave it separate. Lets get generic classes first. > > ---------------- > > This RFC currently doesn't specify in detail how reflection would work. We > have attempted a few API designs, but due to generic classes being ... > generic, it is difficult to find a suitable way to glean information about > a class in a backwards compatible manner. So we will need some help on > this one. > > ----------------- > > Aside from these top issues on our own list, however does everyone feel > about the proposal in general? > As the RFC is still in draft, we will continue to make changes to it as > more popular idea pop up, so please continue. > I think the RFC looks pretty great. I think you guys have put in a lot of very good work speccing it out, thanks for that. As generics are the biggest thing I feel missing that I use elsewhere, I really hope this change gets accepted and fully working implementation! > > Thanks. > > PS: I wasn't properly subscribed to the mailing list, so I missed a few > important messages that were mailed directly to internals, but hopefully > I've managed to fix that now. > --001a1135bf38dae66f0530efd286--