July 23, 2007
Jarrett Billingsley wrote:
> A question -- many of the descriptions of the __traits functions say that "an array is returned."  But some of the samples look like tuples are being used:
> 
> alias typeof(__traits(getVirtualFunctions, D, "foo")) b;
> foreach (t; b)
>     writefln(typeid(t));
> 
> If this really did return an array, the typeof() it would be a single item, not a list, and you wouldn't be able to foreach over it.  So does this return a tuple instead? 

getVirtualFunctions returns a tuple of expressions.
July 23, 2007
Walter Bright wrote:
> Robert Fraser wrote:
>> May I ask why you put the road there before traits? I know there's a std.traits, but perhaps a different keyword entirely or just a single underscore might be more appropriate...? It looks a bit like a compiler-specific extension to me...
> 
> I was thinking they should be buried inside of templates.

But does that affect what the name should be?
July 23, 2007
On Sun, 22 Jul 2007 16:26:28 -0700, Walter Bright <newshound1@digitalmars.com> wrote:

>
>http://www.digitalmars.com/d/1.0/changelog.html http://ftp.digitalmars.com/dmd.1.019.zip
>
>http://www.digitalmars.com/d/changelog.html http://ftp.digitalmars.com/dmd.2.003.zip

Thanks for 1300!

There is a typo in the example for hasMember trait: 'm' struct member should be 'x'.
July 23, 2007
Thank you! Great release!

---

I just would wish, that you don't use so much ugly underscores in front and in the middle of nice D keywords.

It's just a cosmetical issue, but nevertheless why to loose points here if it should be rather easy to change it? Good chance to change it in 2.0 branch...

Probably it should also include __LINE__, __FILE__ and other Special Tokens,  which essentially *are* compile time reflections.

Regards
Marcin Kuszczak


Walter Bright pisze:
> 
> http://www.digitalmars.com/d/1.0/changelog.html
> http://ftp.digitalmars.com/dmd.1.019.zip
> 
> http://www.digitalmars.com/d/changelog.html
> http://ftp.digitalmars.com/dmd.2.003.zip
July 23, 2007
Max Samukha wrote:
> There is a typo in the example for hasMember trait: 'm' struct member
> should be 'x'.  

Got it.
July 23, 2007
Sean Kelly wrote:
> Walter Bright wrote:
>> Robert Fraser wrote:
>>> May I ask why you put the road there before traits? I know there's a std.traits, but perhaps a different keyword entirely or just a single underscore might be more appropriate...? It looks a bit like a compiler-specific extension to me...
>>
>> I was thinking they should be buried inside of templates.
> 
> But does that affect what the name should be?

Don't need a prominent keyword for it.
July 23, 2007
Walter Bright wrote:
> Sean Kelly wrote:
>> Walter Bright wrote:
>>> Robert Fraser wrote:
>>>> May I ask why you put the road there before traits? I know there's a std.traits, but perhaps a different keyword entirely or just a single underscore might be more appropriate...? It looks a bit like a compiler-specific extension to me...
>>>
>>> I was thinking they should be buried inside of templates.
>>
>> But does that affect what the name should be?
> 
> Don't need a prominent keyword for it.

True enough.  I suppose I'm just used to the double-underscore prefix being reserved for compiler extensions.


Sean
July 23, 2007
Thanks for fixing bug 668!

With the new __traits, the documentation for getVirtualFunctions states that it gets the "virtual overloads". What does that mean? If I make some of the methods final, it lists them anyway.

Does it just get all overloads (and should be named getFunctionOverloads), or is there some limitation?
July 23, 2007
Walter Bright wrote:
> 
> http://www.digitalmars.com/d/1.0/changelog.html
> http://ftp.digitalmars.com/dmd.1.019.zip
> 
> http://www.digitalmars.com/d/changelog.html
> http://ftp.digitalmars.com/dmd.2.003.zip

2.0 suddenly becomes very appealing ...

I'm having trouble understanding the difference between "isScalar", "isArithmetic", and "isIntegral". Is this table correct?

int uint real wchar
Y   Y    Y    N     isArithmetic
N   N    Y    N     isFloating
Y   Y    N    Y     isIntegral
Y   Y    Y    Y     isScalar
N   Y    N    N     isUnsigned

----------------
July 23, 2007
Walter Bright wrote:
> 
> http://www.digitalmars.com/d/1.0/changelog.html
> http://ftp.digitalmars.com/dmd.1.019.zip
> 
> http://www.digitalmars.com/d/changelog.html
> http://ftp.digitalmars.com/dmd.2.003.zip

extern(System) works on 2.003, but on 1.019, it prints:
xxx.d(13): valid linkage identifiers are D, C, C++, Pascal, Windows