Shouldn't __traits return Tuples?

Max Samukha samukha at voliacable.com.removethis
Wed Apr 1 01:26:08 PDT 2009


On Thu, 02 Apr 2009 00:07:56 +0200, Trass3r <mrmocool at gmx.de> wrote:

>Max Samukha schrieb:
>> On Wed, 01 Apr 2009 23:22:40 +0200, Trass3r <mrmocool at gmx.de> wrote:
>> 
>>> OMG, I knew the recursion base case was missing, but I couldn't imagine 
>>> how to represent "nothing". Of course, an empty tuple.
>>>
>>> But the reason I posted is cause that bug(?) is still present.
>>> dmd doesn't crash anymore, but using const still doesn't work.
>> 
>> I think it's not a bug because "const" storage class doesn't always
>> mean "compile time". It's rather a variable (we should find a better
>> name) which is initialized once and cannot be changed later. To ensure
>> compiletimeness, you can declare the variable as "static const",
>> "static invariant" or "enum"
>
>Man, static is one of the things that are totally confusing. It has 
>various meanings depending on where you use it and moreover it's hard to 
>find documentation about the one you need cause it's spread all over the 
>docs.

Agree, there are too many meanings of 'static' - global, compile-time,
fixed-size, non-instance. The good thing is that these meanings are
interrelated. Probably, 'static' in module constructor definitions is
redundant. On the other hand, module constructors are not many and
could be otherwise easily confused with class instance constructors.

>
>But what you are talking about is in fact what "final" does (once 
>initialized it can't be changed).

There is no 'final' storage class in D2. Or you are talking about the
concept?



More information about the Digitalmars-d mailing list