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

Justin Johansson no at spam.com
Tue Nov 3 11:52:37 PST 2009


Robert Jacques Wrote:

> 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.

Good point; reducing 'static' to just member variables and functions would
be a positive move.  imho, the word is just way too overloaded in current usage.
As for the candidate words, my preference is still 'meta'.

Justin Johansson




More information about the Digitalmars-d mailing list