Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92821 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45600 invoked from network); 26 Apr 2016 20:15:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Apr 2016 20:15:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@tutteli.ch; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=php@tutteli.ch; sender-id=pass Received-SPF: pass (pb1.pair.com: domain tutteli.ch designates 80.74.144.14 as permitted sender) X-PHP-List-Original-Sender: php@tutteli.ch X-Host-Fingerprint: 80.74.144.14 ns10.kreativmedia.ch Received: from [80.74.144.14] ([80.74.144.14:50789] helo=ns10.kreativmedia.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D8/0C-20013-95CCF175 for ; Tue, 26 Apr 2016 16:15:22 -0400 Received: from RoLaptop (adsl-84-227-2-98.adslplus.ch [84.227.2.98]) by ns10.kreativmedia.ch (Postfix) with ESMTPSA id 9612C47E0297; Tue, 26 Apr 2016 22:15:17 +0200 (CEST) To: "'Rasmus Schultz'" , "'Josh Di Fabio'" Cc: "'Dominic Grostate'" , "'Guilherme Blanco'" , "'Mathieu Rochette'" , "'Ben Scholzen 'DASPRiD''" , "'Sara Golemon'" , "'PHP internals'" , "'Mathieu Rochette'" References: <3cc8a4c7-2640-11ae-a67b-06f909ac1e27@texthtml.net> <57173859.4080501@rochette.cc> In-Reply-To: Date: Tue, 26 Apr 2016 22:15:16 +0200 Message-ID: <013101d19ff8$596b6010$0c422030$@tutteli.ch> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQIuz2pO4BlNO6AEdNznmEmHKOSPUgH8tzyzAcTvi2ACWFsrBwIO1wFmAdxRi5QCZxtKUgESOGzrAqPTpEkCRZ9CuAKMyUA5AeMzfRMCUYkuyp4ZBZkw Content-Language: de-ch Subject: AW: [PHP-DEV] [RFC:generics] From: php@tutteli.ch ("Robert Stoll") > -----Urspr=C3=BCngliche Nachricht----- > Von: Rasmus Schultz [mailto:rasmus@mindplay.dk] > Gesendet: Montag, 25. April 2016 18:09 > An: Josh Di Fabio > Cc: Dominic Grostate; Guilherme Blanco; Mathieu Rochette; Ben Scholzen = 'DASPRiD'; Sara Golemon; PHP internals; Mathieu > Rochette > Betreff: Re: [PHP-DEV] [RFC:generics] >=20 > > 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'. >=20 > I second that. >=20 > I hear the concerns about adding another reserved word "is" though, so = I'd like to suggest simply using a ":" ... as in: >=20 > class A { ... } In this case I would suggest to use class A which leaves room = open to define lower bounds later on (either with <: as well or with :> = as in scala) >=20 > Consistent with return type-hints, it should feel like home? >=20 > For sure nobody wants to type out "instanceof", and (as pointed out in = the RFC) the instanceof operator checks the type of > an object, which is *not* what this is doing - a type argument is not = an "instance of" anything. The ":" is more neutral in that > regard maybe? >=20 >=20 > On Thu, Apr 21, 2016 at 10:32 AM, Josh Di Fabio = wrote: > > 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. >=20 > -- > PHP Internals - PHP Runtime Development Mailing List To unsubscribe, = visit: http://www.php.net/unsub.php