Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51446 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32766 invoked from network); 14 Feb 2011 13:51:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2011 13:51:16 -0000 Authentication-Results: pb1.pair.com header.from=JNettles@inccrra.org; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=JNettles@inccrra.org; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain inccrra.org designates 216.201.124.135 as permitted sender) X-PHP-List-Original-Sender: JNettles@inccrra.org X-Host-Fingerprint: 216.201.124.135 prodexchange02.ilchildcare.org Received: from [216.201.124.135] ([216.201.124.135:40709] helo=mail.inccrra.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 05/31-25176-353395D4 for ; Mon, 14 Feb 2011 08:51:16 -0500 Received: from PRODEXCHANGE02.ilchildcare.org ([fe80::4c32:278c:bd21:337c]) by PRODEXCHANGE02.ilchildcare.org ([fe80::4c32:278c:bd21:337c%23]) with mapi; Mon, 14 Feb 2011 07:51:11 -0600 To: "'internals@lists.php.net'" Thread-Topic: Clarification on the Enum language structure Thread-Index: AcvMThrXv5WrfskLSvWeFN1AlBdYkg== Date: Mon, 14 Feb 2011 13:51:11 +0000 Message-ID: <8423995CEEEA844CB2F964B14BCA94CD043A9686@PRODEXCHANGE02.ilchildcare.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: multipart/alternative; boundary="_000_8423995CEEEA844CB2F964B14BCA94CD043A9686PRODEXCHANGE02i_" MIME-Version: 1.0 Subject: Clarification on the Enum language structure From: JNettles@inccrra.org (Jarrod Nettles) --_000_8423995CEEEA844CB2F964B14BCA94CD043A9686PRODEXCHANGE02i_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I was reading the RFC for the proposed enum language structure and was wond= ering if I could get some clarification on the implementation. Forgive me i= f this is in the patch or has been discussed already but based solely on wh= at is written in the RFC I have some concerns. http://wiki.php.net/rfc/enum Nowhere in the RFC does it mention any of the enumerations as having a name= , like a class would have a name. This seems like a critical point to me, f= or the following reasons. =B7 People will want multiple enumerations. =B7 Other programming languages allow for named enumerations. =B7 Parameters should be able to be type-hinted against enumeration= s just like they are classes. This will be a huge selling point, especially= for framework developers and people who rely heavily on auto-complete from= their IDEs. =B7 It will be difficult to namespace enumerations without a name, = unless the intent is that there is a single global enum per namespace. Also, enums inside of classes should be like any other property or method i= nside of a class in that you should able to mark them as public, private, o= r protected. So, my proposed syntax would look something more like this. namespace System\Logs { enum Levels{ DEBUG, INFO, WARNING, ERROR }; } //or inside of a class namespace System\Syntax { class Tokens{ public enum ControlStatements{ T_IF =3D 258, T_ELSE, T_WHILE, T_DO }; protected enum Operators{ IS_IDENTICAL =3D 15, IS_NOT_IDENTICAL, IS_EQUAL, IS_NOT_EQUAL, IS_SMALLER, IS_SMALLER_OR_EQUAL }; } } Thanks! Jarrod Nettles Application Developer - Technology INCCRRA p 309.829.5327 - f 309.828.1808 This e-mail message may contain privileged or confidential information. If = you are not the intended recipient, you may not disclose, use, disseminate,= distribute, copy or rely upon this message or attachment in any way. If yo= u received this e-mail message in error, please return by forwarding the me= ssage and its attachments to the sender. INCCRRA does not accept liability = for any errors, omissions, corruption or virus in the contents of this mess= age or any attachments that arises as a result of e-mail transmission. Please consider your environmental responsibility before printing this e-ma= il --_000_8423995CEEEA844CB2F964B14BCA94CD043A9686PRODEXCHANGE02i_--