Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92420 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52593 invoked from network); 18 Apr 2016 18:29:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Apr 2016 18:29:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 77.244.243.82 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 77.244.243.82 mx101.easyname.com Received: from [77.244.243.82] ([77.244.243.82:59044] helo=mx205.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3C/4B-11975-C7725175 for ; Mon, 18 Apr 2016 14:29:16 -0400 Received: from cable-81-173-133-226.netcologne.de ([81.173.133.226] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1asDv7-0002QI-1D; Mon, 18 Apr 2016 18:29:13 +0000 Reply-To: internals@lists.php.net References: <5714C647.7030505@gmail.com> <5714CC79.6040506@gmail.com> To: Rowan Collins , Joe Watkins Cc: PHP internals Message-ID: <5715276A.2000505@fleshgrinder.com> Date: Mon, 18 Apr 2016 20:28:58 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <5714CC79.6040506@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6aO4mv1bNQou3dfT6JNGoJd7nn7r4KlU4" X-ACL-Warn: X-DNSBL-BARRACUDACENTRAL Subject: Re: [PHP-DEV] RFC: Functional Interfaces From: php@fleshgrinder.com (Fleshgrinder) --6aO4mv1bNQou3dfT6JNGoJd7nn7r4KlU4 Content-Type: multipart/mixed; boundary="GM78NlagFFiIkWHjOHsPvvkBE5tRrELjo" From: Fleshgrinder Reply-To: internals@lists.php.net To: Rowan Collins , Joe Watkins Cc: PHP internals Message-ID: <5715276A.2000505@fleshgrinder.com> Subject: Re: [PHP-DEV] RFC: Functional Interfaces References: <5714C647.7030505@gmail.com> <5714CC79.6040506@gmail.com> In-Reply-To: <5714CC79.6040506@gmail.com> --GM78NlagFFiIkWHjOHsPvvkBE5tRrELjo Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable +1 for the feature, very nice syntactic sugar to solve some edge cases. I agree with Rowan, i also do not like the name and propose to call them *closure interfaces*. There are already various synonyms for closures: - anonymous function - lambda function - callback* However, the strongest argument to call them *closure* is the fact that the the class in PHP itself is actually called *\Closure*. I would even go as far as saying that the documentation should be updated to always use that word everywhere.* The fact that only closures can implement such interfaces strengthens the reason to call them as proposed in my opinion. Just because Java calls them /functional/ does not mean that we should. Regarding error messages: Fatal error: cannot implement non functional interface IFoo in /in/65W6i on line 7 Fatal error: cannot implement nonclosure interface IFoo in /in/65W6i on line 7 Note on grammar: http://www.chicagomanualofstyle.org/qanda/data/faq/topics/HyphensEnDashes= EmDashes/faq0079.html *) There is of course the situation of the various other ways to declare the so called *user functions* (/call_user_func()/ and /call_user_func_array()/) and those should always be referred to as *callback*; imho. --=20 Richard "Fleshgrinder" Fussenegger --GM78NlagFFiIkWHjOHsPvvkBE5tRrELjo-- --6aO4mv1bNQou3dfT6JNGoJd7nn7r4KlU4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXFSdxAAoJEOKkKcqFPVVr/lIP/jk+IFCb3whH2ER+0Jefnpsv JPkWO9kHlTawSQ88yUX3Dno4XYTMwo+eNT2DadYxJwdM0mvGmC6eL4Dru7TcAFZ0 6R0UbnjdtktyiXONBidqLweBkFMSiLgkTY+hwyRCYkRhyk8Jp8sF5Z2NLWw7Zwbt ERuQ7bzUogvgPpoCqkNOpvTU9SlFt+GUHbBZXrKKq7YSI3I8m4P7b14ywKqtQNVY Qo3mekCC992WVEn/ODk7+9yWXjzh27RmajUg5st7OwQDouZqJi9PQqM9n65zQyDz qxUse72ZNdn/xj8p0Ylg77D671UacbR3AbC1G57L+ctW5/7ektDcjC8bkeiY4gzv IFomKLtYKOc/mMFUb2NN0iVZbgxvPwel343vcr7+fbo61L+FZruUoK9spFr8SG72 vENWpEYnaUnH5ulaDd666HfYlg3Ldk5DldF4mRPXeVPM2rAGwf/FJ6W8STk22n65 LQE6+qD/NyREi4d8BQFCclYCguIA/xZRT39c0Gr4VQW8CRNgPwft8ggTmSrJhHR4 dX9DUIC88JmMau26jCs0voZGls7wMjExyhE+jo4scp3bxrKU9+Lzl4LuERYhieeg 976wos3Lgwy8kKNLrPMePjAdnTPeAxnDaUXJNyXpQWnjzgCFvW6eJfepkm5p/Y0k U2b+limn8krP6EA3mkXQ =ebCB -----END PGP SIGNATURE----- --6aO4mv1bNQou3dfT6JNGoJd7nn7r4KlU4--