Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92588 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54911 invoked from network); 21 Apr 2016 08:32:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Apr 2016 08:32:18 -0000 Authentication-Results: pb1.pair.com header.from=joshdifabio@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=joshdifabio@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.68 as permitted sender) X-PHP-List-Original-Sender: joshdifabio@gmail.com X-Host-Fingerprint: 209.85.218.68 mail-oi0-f68.google.com Received: from [209.85.218.68] ([209.85.218.68:33709] helo=mail-oi0-f68.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2E/4D-14036-11098175 for ; Thu, 21 Apr 2016 04:32:18 -0400 Received: by mail-oi0-f68.google.com with SMTP id f63so8996268oig.0 for ; Thu, 21 Apr 2016 01:32:17 -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=OheEZ6wYnfbplqHtHkEe4/VmVrHCFvoLrN5i1+Vi7oU=; b=VxL9CwZGZEyyoi48tTNVgpp0d5vPK/gPYsJ3+fSx6bSr/jEcwoS+H58PFg7SUj6IDD 5s6BNLT+vS7eXu61zrCkeNEe5M+4SLX5b//yLi2kArb8vxs5gjpeRVo8a/I2y7739JAr zDzo7qJIby7d4Uncu9mLeIi8OXw/ehJ6D3FeBZtuGYzT6qI1PWhJKv3/1DXdLb1QMleF tWwO+guP7Ynx2ZRxTEysXBsI2wjzPpWn2sHw+HYoQK7/4WcYsezkqzjNUjYPRjKlE4A7 +rDr59dUEVhiN0QlxxAwQaWBJ8bv9es8lMfI+4wbvPvB2edz8IsDSst+qT+aDe1NuiA9 HvYQ== 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=OheEZ6wYnfbplqHtHkEe4/VmVrHCFvoLrN5i1+Vi7oU=; b=L6/Zg4YKvAgMQOTpJ/Y3wuacUWriDFPEUIArj0C9T3q6XKe603TExENN5dAyGVZzJE 549/felJ5wffpA1N7urxiMU51F7zi8qVUxxwAFsW8EopMCrXHxpfayQEp6zKOrrou3wg fGjjHU8TK9hbKtZtTwZEYb9aGN47ACHXHTzjQ1ScRJULfks6yEnKpLNqu3X6ef19cPSq 1x+CKx2NWmZcMlhjqt7p5c4qQTWGKIqSGbJkYyLyPv92TrL4V5xBJgl+C6CHQr7HH+u4 J8K/4Fabodb7R4JGkR80/ns8I6b+CO40Bo46fIahI8FprZsm9O0YRTRRovebPMvQyZ61 cJBQ== X-Gm-Message-State: AOPr4FXLagL53G+l2E4hEJmy6/gI6SIaX8+wPBB7i530T6RSvkDf26BUyUoeOSlnthD9LlkFynCZ4ubjiE428w== MIME-Version: 1.0 X-Received: by 10.202.234.135 with SMTP id i129mr5395941oih.10.1461227534650; Thu, 21 Apr 2016 01:32:14 -0700 (PDT) Received: by 10.202.78.134 with HTTP; Thu, 21 Apr 2016 01:32:14 -0700 (PDT) In-Reply-To: References: <3cc8a4c7-2640-11ae-a67b-06f909ac1e27@texthtml.net> <57173859.4080501@rochette.cc> Date: Thu, 21 Apr 2016 09:32:14 +0100 Message-ID: To: Dominic Grostate Cc: Guilherme Blanco , Mathieu Rochette , "Ben Scholzen 'DASPRiD'" , Sara Golemon , PHP internals , Rasmus Schultz , Mathieu Rochette Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC:generics] From: joshdifabio@gmail.com (Josh Di Fabio) On Wed, Apr 20, 2016 at 8:17 PM, Dominic Grostate 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 really don't like 'as' in this context, even if Hack uses it, as it doesn't reflect in English terms what the code is doing. As others have already said, it reads as if 'T' is being aliased to 'Bar'. On Wed, Apr 20, 2016 at 8:17 PM, Dominic Grostate 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. > > ---------------- > > 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. > > ---------------- > > 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 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. > > 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.