My thoughts & experiences with D so far, as a novice D coder

1100110 0b1100110 at gmail.com
Thu Mar 28 02:02:56 PDT 2013


On 03/27/2013 03:47 PM, Steven Schveighoffer wrote:
> On Wed, 27 Mar 2013 14:09:07 -0400, Nick Sabalausky
> <SeeWebsiteToContactMe at semitwist.com> wrote:
>
>> On Wed, 27 Mar 2013 14:07:27 -0400
>> Nick Sabalausky <SeeWebsiteToContactMe at semitwist.com> wrote:
>>
>>> On Wed, 27 Mar 2013 13:08:19 -0400
>>> >
>>> > I just tested it, it works on enum *strings*, but not enum *values*
>>> >
>>> > For example:
>>> >
>>> > import std.conv;
>>> >
>>> > enum X {
>>> > i, j, k
>>> > }
>>> >
>>> > void main()
>>> > {
>>> > X x = to!X("i"); // works!
>>> > x = to!X(1); // fails!
>>> > }
>>> >
>>>
>>> Works for me on 2.063 Win. Keep in mind:
>>>
>>> assert(cast(int)X.i == 0);
>>> assert(cast(int)X.j == 1);
>>>
>>
>> I meant of course 2.062
>>
>
> Hah, I have not yet downloaded 2.062. It did not work in 2.061, not sure
> if that was a bug or it's a new feature.
>
> anyway, that is good to know!
>
> -Steve

It worked for me in 2.061, as that's what I'm currently on.


Waiting to build the release that I hear might have shared objects!


More information about the Digitalmars-d mailing list