Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92600 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90516 invoked from network); 21 Apr 2016 17:26:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Apr 2016 17:26:51 -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:35754] helo=ns10.kreativmedia.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DA/B2-14036-85D09175 for ; Thu, 21 Apr 2016 13:26:49 -0400 Received: from RoLaptop (adsl-84-227-2-98.adslplus.ch [84.227.2.98]) by ns10.kreativmedia.ch (Postfix) with ESMTPSA id 89F8A47E5721; Thu, 21 Apr 2016 19:26:44 +0200 (CEST) To: "'Rasmus Schultz'" , "'PHP internals'" Cc: "'Ben Scholzen'" , "'Dominic Grostate'" References: In-Reply-To: Date: Thu, 21 Apr 2016 19:26:41 +0200 Message-ID: <014301d19bf2$f82ec2a0$e88c47e0$@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: AQIuz2pO4BlNO6AEdNznmEmHKOSPUp7aRO+A Content-Language: de-ch Subject: AW: [PHP-DEV] [RFC:generics] From: php@tutteli.ch ("Robert Stoll") Hi Rasmus =20 > Hello internals, >=20 > I'd like to introduce an RFC proposing the addition of generic types = and functions: >=20 > https://wiki.php.net/rfc/generics >=20 > Ben Scholzen started this RFC as a quick draft with a few code samples = in August last year, and I have since then worked > with Dominic and Ben towards a more complete, detailed RFC. >=20 > There are a few holes still, which is why it hasn't moved from Draft = to Under Discussion yet, but we feel that it's complete > enough that we can start a discussion about this feature and try to = iron out the remaining details. >=20 > The RFC was previously "unofficially" announced on reddit - this = thread generated some good questions and may answer > some of the most immediate questions: >=20 > = https://www.reddit.com/r/PHP/comments/3zx8qs/php_rfcgenerics_update_03_pl= ease_comment/ >=20 > One of the most common criticisms we've heard, is that the syntax = would be hard to implement, a few have said > "impossible" - but we feel that, if generics are introduced, it's = important that the syntax and features be as familiar as > possible to developers who are experienced with other mainstream web = industry languages, such as C# and Java. >=20 > To that end, Dominic Grostate has worked through most of the = tokenizer/parser issues - save for one very exotic edge > case, his fork demonstrates that the proposed syntax can be parsed: >=20 > https://github.com/orolyn/php-src/commits/generics >=20 > Note that this fork is by no means an implementation of generics - it = is proof of concept as far as being able to parse the > syntax. >=20 > We're hoping to find someone, with more experience working on the php = codebase, who is willing to collaborate on > further implementation - and we do also have a partial test-suite, = defining the big picture expectations for most of the > proposed language features: >=20 > = https://github.com/orolyn/php-src/tree/generics-tests/Zend/tests/generics= >=20 > We look forward to your comments, questions and (I'm sure) criticisms = of this proposal! >=20 > Thank You, >=20 > Regards, > Rasmus Schultz >=20 > -- > PHP Internals - PHP Runtime Development Mailing List To unsubscribe, = visit: http://www.php.net/unsub.php Some questions about bounds checking: - Example A: why don't you pass T (instead of Computer) to = MachineBuilder? Just for the example or is it not possible with your = approach? - What about lower bounds? In you examples about type checking you write: > var_dump($hat_box instanceof Box); // =3D> (bool) true Will you support "raw types" similar as in Java, if so why? you wrote: > TODO: decide whether or not bounded polymorphism should be supported. I am a bit confused, isn't parametric polymorphism combined with upper = bounds already bounded polymorphism?