Proposal: Replace __traits and is(typeof(XXX)) with a 'magic namespace'.

Robert Jacques sandford at jhu.edu
Tue Nov 3 10:20:16 PST 2009


On Tue, 03 Nov 2009 13:10:26 -0500, Bill Baxter <wbaxter at gmail.com> wrote:

> On Tue, Nov 3, 2009 at 7:47 AM, Leandro Lucarella <llucax at gmail.com>  
> wrote:
>> rmcguire, el  3 de noviembre a las 15:11 me escribiste:
>>> Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org> wrote:
>>> I really like 'static' as the namespace, it would be awesome if it did  
>>> not just
>>> contain 'meta' stuff.
>>>
>>> Could we lose 'pragma', 'typeof', unary 'is', 'typeid', '__traits'.
>>>
>>> It makes a lot of sense to just say to someone "if you want to do  
>>> something at
>>> compile time, just check the 'static' documentation".
>>
>> static.if(...) {
>>        static.foreach(...) {
>>                static.assert(...) {
>>                }
>>        }
>> }
>>
>> =P
>>
>
> At first I thought this was another joke about how overused "static"
> is.  But actually it does kinda make sense here.
>
> --bb

I agree. Though, other keywords could work in this manner just as well  
(pragma comes to mind), which would reduce static to just member variables  
and functions.



More information about the Digitalmars-d mailing list