Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88357 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18623 invoked from network); 18 Sep 2015 21:00:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Sep 2015 21:00:59 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.173 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.173 mail-wi0-f173.google.com Received: from [209.85.212.173] ([209.85.212.173:33769] helo=mail-wi0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D0/91-09127-A8B7CF55 for ; Fri, 18 Sep 2015 17:00:59 -0400 Received: by wiclk2 with SMTP id lk2so79208021wic.0 for ; Fri, 18 Sep 2015 14:00:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type:subject:from:date:to :message-id; bh=hSGnFcTUz1ewmfBikWNZyhmoUtoYxh5UfxzvNwYcxkY=; b=y1OMtFTh6rUj1MEqSqE71WHI5aWlQwyzqfYO2G3VsAjLEolK7wFDGBojchO7mBRWtS L2urps81kKbUsspWpPUVAz4+7Y4ZrOP9ykMd2szOWPHRcKGKWos2M06K8y/malvdAJm9 DDk8eEnEU7yqlsSYJqQsyFegbKhQIjhOwADX0mb0U82YIO+w8zgo5vOn/0y601QuPtOr kxxs0dqE9i3swv94VTvnZN0FT/p2UuozrVc/kWqyHkZPHkLeu3lIayByQwwmJl4aokFX 7+ZiKh3UjdKHFvgg4sNVpy2paTGsRYWrRAJl4xcS8DFV/vm+oYcFdsQs9cWdMR+SUl/j nIJw== X-Received: by 10.194.113.101 with SMTP id ix5mr10347953wjb.66.1442610055913; Fri, 18 Sep 2015 14:00:55 -0700 (PDT) Received: from [192.168.0.6] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by smtp.gmail.com with ESMTPSA id qc4sm10667858wjc.33.2015.09.18.14.00.54 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Sep 2015 14:00:55 -0700 (PDT) User-Agent: K-9 Mail for Android In-Reply-To: References: <55FB4791.4040807@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Date: Fri, 18 Sep 2015 21:59:47 +0100 To: Stephen Coakley ,internals@lists.php.net Message-ID: <454985F0-4C29-4329-B27E-FA6340FC0BC4@gmail.com> Subject: Re: [PHP-DEV] Re: Let's discuss enums! From: rowan.collins@gmail.com (Rowan Collins) On 18 September 2015 03:58:57 BST, Stephen Coakley wrote: >On 09/17/2015 06:06 PM, Rowan Collins wrote: >> member THURSDAY, FRIDAY, SATURDAY, SUNDAY; // don't force people >to >> write each entry on its own line; maybe even the "member" keyword is >too >> much? > >Member is even a little too much IMO. A comma-separated list syntax >would be better, simply because its shorter and more similar to enum >syntax on other languages. The keyword just felt like it fitted better with the rest of the language, and made the list look less like it's floating when there are other things in the braces (fields, methods, etc). But as you say it's common in other languages to simply have a comma separated list at the start of the declaration, before anything else. I didn't want to get too bogged down in the syntax, though, more to gauge reaction to the general direction, which can be summed up as "an enum is an immutable object, with an easily available name but no other default properties, and a mechanism for decorating with additional properties and methods as desired". Regards, -- Rowan Collins [IMSoP]