April 06, 2014
On Sunday, 6 April 2014 at 19:53:43 UTC, Paulo Pinto wrote:
>> A counterexample is Go, which has gotten a lot of traction with a simple
>> syntax.
>
> It has more to do with Google than with the language's design.

That, and being perceived as a http-server-language and having standard libraries and a threading model geared towards web servers.

In addition Go has managed to improve the C syntax by removing in-most-cases redundant syntax. Which is quite nice for readability, IMO.
April 06, 2014
On 4/6/14, 10:52 AM, Walter Bright wrote:
> On 4/6/2014 3:31 AM, Leandro Lucarella wrote:
>> What I mean is the current semantics of enum are as they are for
>> historical reasons, not because they make (more) sense (than other
>> possibilities). You showed a lot of examples that makes sense only
>> because you are used to the current semantics, not because they are the
>> only option or the option that makes the most sense.
>
> I use enums a lot in D. I find they work very satisfactorily. The way
> they work was deliberately designed, not a historical accident.

Sorry, I think they ought to have been better. -- Andrei

April 07, 2014
On 4/6/2014 4:17 PM, Andrei Alexandrescu wrote:
> On 4/6/14, 10:52 AM, Walter Bright wrote:
>> I use enums a lot in D. I find they work very satisfactorily. The way
>> they work was deliberately designed, not a historical accident.
>
> Sorry, I think they ought to have been better. -- Andrei

Sorry, yer wrong!
April 07, 2014
On Mon, 07 Apr 2014 00:17:45 +0100, Andrei Alexandrescu <SeeWebsiteForEmail@erdani.org> wrote:

> On 4/6/14, 10:52 AM, Walter Bright wrote:
>> On 4/6/2014 3:31 AM, Leandro Lucarella wrote:
>>> What I mean is the current semantics of enum are as they are for
>>> historical reasons, not because they make (more) sense (than other
>>> possibilities). You showed a lot of examples that makes sense only
>>> because you are used to the current semantics, not because they are the
>>> only option or the option that makes the most sense.
>>
>> I use enums a lot in D. I find they work very satisfactorily. The way
>> they work was deliberately designed, not a historical accident.
>
> Sorry, I think they ought to have been better. -- Andrei

Got a DIP/spec/design to share?

R

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/
April 07, 2014
On Monday, 7 April 2014 at 10:07:03 UTC, Regan Heath wrote:
> Got a DIP/spec/design to share?
>
> R

I think biggest mistake of D enums is merging constants and actual enumerations into single entity which has resulted in weak typing of enumerations.
April 07, 2014
Am 07.04.2014 12:07, schrieb Regan Heath:
> On Mon, 07 Apr 2014 00:17:45 +0100, Andrei Alexandrescu
> <SeeWebsiteForEmail@erdani.org> wrote:
>
>> On 4/6/14, 10:52 AM, Walter Bright wrote:
>>> On 4/6/2014 3:31 AM, Leandro Lucarella wrote:
>>>> What I mean is the current semantics of enum are as they are for
>>>> historical reasons, not because they make (more) sense (than other
>>>> possibilities). You showed a lot of examples that makes sense only
>>>> because you are used to the current semantics, not because they are the
>>>> only option or the option that makes the most sense.
>>>
>>> I use enums a lot in D. I find they work very satisfactorily. The way
>>> they work was deliberately designed, not a historical accident.
>>
>> Sorry, I think they ought to have been better. -- Andrei
>
> Got a DIP/spec/design to share?
>
> R
>

How they work in languages like Ada.

--
Paulo
April 07, 2014
On Monday, 7 April 2014 at 12:04:15 UTC, Dicebot wrote:
> On Monday, 7 April 2014 at 10:07:03 UTC, Regan Heath wrote:
>> Got a DIP/spec/design to share?
>>
>> R
>
> I think biggest mistake of D enums is merging constants and actual enumerations into single entity which has resulted in weak typing of enumerations.

Which leads to things like not being able to use enums of
class type or struct type in switch statements.

-Eric
April 07, 2014
On Mon, 07 Apr 2014 16:15:41 +0100, Paulo Pinto <pjmlp@progtools.org> wrote:

> Am 07.04.2014 12:07, schrieb Regan Heath:
>> On Mon, 07 Apr 2014 00:17:45 +0100, Andrei Alexandrescu
>> <SeeWebsiteForEmail@erdani.org> wrote:
>>
>>> On 4/6/14, 10:52 AM, Walter Bright wrote:
>>>> On 4/6/2014 3:31 AM, Leandro Lucarella wrote:
>>>>> What I mean is the current semantics of enum are as they are for
>>>>> historical reasons, not because they make (more) sense (than other
>>>>> possibilities). You showed a lot of examples that makes sense only
>>>>> because you are used to the current semantics, not because they are the
>>>>> only option or the option that makes the most sense.
>>>>
>>>> I use enums a lot in D. I find they work very satisfactorily. The way
>>>> they work was deliberately designed, not a historical accident.
>>>
>>> Sorry, I think they ought to have been better. -- Andrei
>>
>> Got a DIP/spec/design to share?
>>
>> R
>>
>
> How they work in languages like Ada.

Ok, brief look at those shows me enums can be converted to a "Pos" index but otherwise you cannot associate a numberic value with them, right?

So if we had that in D, Walters examples would look like..

1)

  enum Index { A, B, C }
  T[Index.C.pos + 1] array; // perhaps?
  ...
  array[Index.B.pos] = t;   // yes?

2)

  array[Index.A.pos + 1] = t; // yes?

3)

  enum Mask { A=1,B=4 } // not possible?

  Mask m = A | B;   // Error: incompatible operator | for enum


Have I got that right?

For a proposal like this to even be considered I would imagine it would have to be backward compatible with existing uses, so you would have to be proposing a new keyword or syntax on "enum" to trigger typesafe enums, perhaps "typesafe" is a good keyword, e.g.

typesafe enum Index { A, B, C } // requires use of .pos to convert to int 0, 1, or 2.
enum Index { A, B, C }          // existing pragmatic behaviour

R

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/
April 07, 2014
On 4/7/14, 3:07 AM, Regan Heath wrote:
> On Mon, 07 Apr 2014 00:17:45 +0100, Andrei Alexandrescu
> <SeeWebsiteForEmail@erdani.org> wrote:
>
>> On 4/6/14, 10:52 AM, Walter Bright wrote:
>>> On 4/6/2014 3:31 AM, Leandro Lucarella wrote:
>>>> What I mean is the current semantics of enum are as they are for
>>>> historical reasons, not because they make (more) sense (than other
>>>> possibilities). You showed a lot of examples that makes sense only
>>>> because you are used to the current semantics, not because they are the
>>>> only option or the option that makes the most sense.
>>>
>>> I use enums a lot in D. I find they work very satisfactorily. The way
>>> they work was deliberately designed, not a historical accident.
>>
>> Sorry, I think they ought to have been better. -- Andrei
>
> Got a DIP/spec/design to share?

No. -- Andrei

April 07, 2014
On 4/7/14, 5:04 AM, Dicebot wrote:
> On Monday, 7 April 2014 at 10:07:03 UTC, Regan Heath wrote:
>> Got a DIP/spec/design to share?
>>
>> R
>
> I think biggest mistake of D enums is merging constants and actual
> enumerations into single entity which has resulted in weak typing of
> enumerations.

That ain't the biggest. Biggest is unsound operations. -- Andrei