Implicit enum conversions are a stupid PITA

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Mar 24 14:11:57 PDT 2010


On 03/24/2010 02:34 PM, Nick Sabalausky wrote:
> "Andrei Alexandrescu"<SeeWebsiteForEmail at erdani.org>  wrote in message
> news:hodla0$2sta$1 at digitalmars.com...
>> On 03/24/2010 12:57 PM, Nick Sabalausky wrote:
>>> "Andrei Alexandrescu"<SeeWebsiteForEmail at erdani.org>   wrote in message
>>> news:hod5o3$1nhg$1 at digitalmars.com...
>>>>
>>>>
>>>> Who are "they"?
>>>>
>>> He was modifying the common expression "Those who don't learn from the
>>> past
>>> are doomed to repeat it."
>>
>> But paraphrasing ain't "as they say" because they don't say that. Besides,
>> I thought he's paraphrasing "Any sufficiently complicated C or Fortran
>> program contains a buggy implementation of Common Lisp." But I guess
>> that's just me being cranky - I'm sick.
>>
>
> Ok, I'm not going to get baited into picking apart minute details of
> someone's exact choice of wording.
>
>
>>>> Why does a mechanism that allows creating bitfields, custom enums,
>>>> flags,
>>>> custom-base literals, and more, feel hackish,
>>>
>>> Because it involves passing everything as parameters to a
>>> string-mixin-generating function/template. Powerful as such as thing is,
>>> and
>>> as much as I like having that ability available, it is a rather blunt
>>> instrument and does tend to feel very hackish.
>>
>> Feeling is subjective. To me it doesn't.
>>
>
> And so what, that proves it isn't hackish? Point is, there are people who do
> find it hackish, and saying "I don't" hardly addresses the issue.
>
>
>>> Also, looking at the docs for bitmanip, it looks like "bitfields" creates
>>> a
>>> "BitArray". But the interface for bitarray doesn't really seem to match
>>> the
>>> conceptual-level operations performed on bitfields any more than just
>>> using
>>> an ordinary uint would, and it doesn't seem to solve most of the problems
>>> with doing so, either.
>>
>> Nonsense. bitfields does not create a BitArray and does exactly what you'd
>> expect some bit fields to do. To saliently criticize an artifact, it does
>> help to understand it.
>>
>> First, custom bitfields are taken care of appropriately by bitfield. You
>> may want to try it before replying. Second, this thread is about enums
>> that are bitwise flags, so I take it you replied to disagree with every
>> paragraph I wrote.
>>
>
> "it does help to understand it"<- Which is why I went and double-checked
> the docs. The docs didn't say anything about what "bitfields" actually
> created, but it did have a big definition of the "BitArray" type right
> there, and no other types were mentioned besides FloatRep and DoubleRep
> (which were clearly mere uses of "bitfields"), so I assumed. Clearly I
> assumed wrong, big fucking deal. That's no reason to get all pissy about it.
>
>
>>>> while still failing to address major problems (concurrency,
>>>> immutability)
>>>> feels not?
>>>>
>>>
>>> I don't think anyone's suggesting that things like concurrency and
>>> immutability should fail to be addressed.
>>
>> Then stop extolling the virtues of an obscure feature.
>>
>
> Wow, cranky indeed.

Apology accepted :oD.

Andrei



More information about the Digitalmars-d mailing list