Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93343 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52141 invoked from network); 15 May 2016 18:20:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 May 2016 18:20:48 -0000 Authentication-Results: pb1.pair.com header.from=inefedor@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=inefedor@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.47 as permitted sender) X-PHP-List-Original-Sender: inefedor@gmail.com X-Host-Fingerprint: 209.85.215.47 mail-lf0-f47.google.com Received: from [209.85.215.47] ([209.85.215.47:35739] helo=mail-lf0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D5/0A-48938-FFDB8375 for ; Sun, 15 May 2016 14:20:47 -0400 Received: by mail-lf0-f47.google.com with SMTP id j8so109031809lfd.2 for ; Sun, 15 May 2016 11:20:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ItCAL1Kto6FcoFWZWrxWW1w6wIEaXm0T9LOSmJGLf+E=; b=sNeQbuqv2dgUQSbo8877i2IVU25ybCMCfgZMS/J98ydhDlpsljGrZx038+TSOWQhOF YKSFtRf33ViMytra7RdLrJr3+Lhlc56vIdB6ZHcZ7Ty+k4FAdVb2AxiYCftG6OnHcg8X S3ByzauGVOTsQqcDBFptu5FkSVr/ir/Jz2yG0vGfJyyaIIR9Sv/xqJEYF4dEESeo0jjF ERFtMksQHqFmZCoYN4EbWVtO7E4SRRi/IURfaX6CkXKM0yEkIGuWDO7q9h3qZN3wH/4P ThOCRdYP0GPUbF2EZCRhVSLVgpTWP2bCG0SAV2Gd7Gz/IMBV7oSWLsV/PTyZLO4p34ud gnuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ItCAL1Kto6FcoFWZWrxWW1w6wIEaXm0T9LOSmJGLf+E=; b=Hjy8X2gTg9HcS21xWLF7teSlWGA14mEpXDuxqJ+DUebF3aPWiZFEISNghYsRD8nyM8 THtuHwfwyOWE9CN79r1/sgMQO34p5nWayGvZyuH9u+Q6Ox9+wbxxtU84tVAulsKnnFOb 3L66CTKURzP10I6Ni8ODWFfoDfoBkFtr99z78L+q0oVKyBe8IrzNgMyUhoZ1IyiJN7Ci 0Qg4YdCCjZn5lR/zmhFXpAdZoh3A4bbQYBxae8cAOw1PbR/GuwNwNNwlkXyzWkVAVo+w FouhdaN7wCGQQmnE8yHukBWgDiZUo2p5BoUhARik2feaiG8HExzLWPDQEfbpoLlCoveU 4s0Q== X-Gm-Message-State: AOPr4FUIC2kX+YkZt6pXN3/HBA/CTjajmMs7lQj59yAAPz3dOGbY+MsQ8+pxQuoBsBPpUg== X-Received: by 10.25.207.131 with SMTP id f125mr11099151lfg.62.1463336444605; Sun, 15 May 2016 11:20:44 -0700 (PDT) Received: from [192.168.88.197] (broadband-95-84-234-130.nationalcablenetworks.ru. [95.84.234.130]) by smtp.gmail.com with ESMTPSA id w17sm3214368lfd.45.2016.05.15.11.20.43 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 15 May 2016 11:20:43 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) X-Mailer: iPhone Mail (13E238) In-Reply-To: Date: Sun, 15 May 2016 21:20:42 +0300 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <44BB42FB-4991-4531-827D-AF6A97B2675B@gmail.com> References: To: Dan Ackroyd Subject: Re: [PHP-DEV] [RFC][VOTE] Closure from callable From: inefedor@gmail.com (Nikita Nefedov) > On 15 May 2016, at 20:29, Dan Ackroyd wrote: >=20 > Hello, >=20 > I've opened the voting for the Closure from callable RFC - > https://wiki.php.net/rfc/closurefromcallable >=20 > Just to note, some people I've spoken to have expressed a desire to > have a more powerful syntax where 'bare' function names are used, > like: >=20 > callable(someFunctionName) > callable($this->method) >=20 > I fully agree with those people, however I can't see anyway to do that > before PHP 8. It would almost certainly need some clean up of the > allowed syntax to disambiguate what `$this->method` means for: >=20 > class Foo { > public $method; > public function method() { } > } >=20 > Leaving that top-level function name available for future versions, > where we might be able to support it properly, is one of the reasons > to use the more verbose function name. Hey Dan, why would you need to support a $this->fieldName case though? If it's a fiel= d it probably already contains a closure (or, well, if you need to make a cl= osure from arbitrary callable we could have a Closure::fromCallable named ct= r). Instead of making a function 'callable()', we could make a language cons= truct: expr: ... | T_CALLABLE '(' callable_expr ')' callable_expr: '$this->' function_name | class_name '::' function_name | function_name This would have an advantage of being statically checked (hence easier refac= toring in IDEs). I see merging symbol tables as a pretty big of a deal for too much people, t= his thing alone could easily create another case of Python 3 syndrome.