Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41563 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54243 invoked from network); 29 Oct 2008 19:51:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Oct 2008 19:51:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=php-php-dev@m.gmane.org; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=news@ger.gmane.org; sender-id=pass Received-SPF: pass (pb1.pair.com: domain m.gmane.org designates 80.91.229.2 as permitted sender) X-PHP-List-Original-Sender: php-php-dev@m.gmane.org X-Host-Fingerprint: 80.91.229.2 main.gmane.org Linux 2.5 (sometimes 2.4) (4) Received: from [80.91.229.2] ([80.91.229.2:52596] helo=ciao.gmane.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DE/54-24509-3BEB8094 for ; Wed, 29 Oct 2008 14:51:16 -0500 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KvH4Q-0000Hq-9Z for internals@lists.php.net; Wed, 29 Oct 2008 19:51:10 +0000 Received: from maclaurin-seven-nineteen.mit.edu ([18.53.5.208]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 29 Oct 2008 19:51:10 +0000 Received: from edwardzyang by maclaurin-seven-nineteen.mit.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 29 Oct 2008 19:51:10 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: internals@lists.php.net Date: Wed, 29 Oct 2008 15:50:59 -0400 Lines: 15 Message-ID: References: <7E40142348CB4407881593314363972A@pc> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: maclaurin-seven-nineteen.mit.edu User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) In-Reply-To: <7E40142348CB4407881593314363972A@pc> Sender: news Subject: Re: [PHP-DEV] Proposal for new construct: nameof From: edwardzyang@thewritingpot.com ("Edward Z. Yang") Stan Vassilev | FM wrote: > I suggest we introduce a new construct which will return a string when passed any identifier to resolve against the current file's use clauses: > > nameof Symbol\Name; > > With this identifier, the above example can be "normalized" to the following code: I second this suggestion. One thing that would be awesome is if we could drop nameof completely (i.e. all class/function names are first class data) like F::loadFunc(B\Baz), but I doubt it would be possible with the parser (at the very least, it wouldn't work for items without a namespace separator, since it could be construed as a constant). Cheers, Edward