May 19, 2005
"Kris" <fu@bar.com> wrote in message news:d6iq1n$2esk$1@digitaldaemon.com...
> Calling through interfaces is broken in 0.124 and 0.123; perhaps not all uses, but enough to trash the core of the Mango libraries. Dmd 0.121 is good, as are prior versions all the way back to 0.8x something. There's a post in the buglist.

Thanks. I'll try and figure out what went wrong.


May 20, 2005
Finally! :)

For me everything is fine except case #2:
"The condition is always satisfied, and Identifier is declared to be an
alias of Type. "

What is the intention, your honour?

Andrew.



"Walter" <newshound@digitalmars.com> wrote in message news:d6imvd$2c53$1@digitaldaemon.com...
> I'm not too sure about iftype. Let's see how it goes. Consider it 'experimental' for now.
>
> http://www.digitalmars.com/d/changelog.html
>
>
> 


May 20, 2005
"Walter" <newshound@digitalmars.com> wrote in message news:d6imvd$2c53$1@digitaldaemon.com...

Ooh, some nice new things to try out :)

Something I've wondered though - will the .size ever bee just ignored?  It seems kind of redundant to have an error just for .size when it could just say "no member .size for blah."  I suppose the error is just there for porting older D code, but will this error be removed for 1.0?


May 20, 2005
"Andrew Fedoniouk" <news@terrainformatica.com> wrote in message news:d6jfrq$2uk1$1@digitaldaemon.com...
> Finally! :)
>
> For me everything is fine except case #2:
> "The condition is always satisfied, and Identifier is declared to be an
> alias of Type. "
>
> What is the intention, your honour?

It's just the degenerate case.


May 20, 2005
Seems like 'static if' and 'iftype' are the same statement. Difference is just in type of condition expression.

Is it possible to combine them together somehow and to have
just one static if? (I personally prefer 'when' instead of 'static if' but
anyway...

Currently in D, notation of 'if' statement is as:

IfStatement:
    if ( Expression ) Statement [else Statement]

So if we will add:
    static if ( Expression ) Statement [else Statement]
    static if typeof ( TypeParameter ) Statement [else Statement]

then it will not break existing grammar.

Other forms of latter two productions using 'when':

    when ( Expression ) Statement [else Statement]
    when typeof ( TypeParameter  ) Statement [else Statement]

I think that D should have clear "notational distance"
between runtime and compile time constructions.
static assert and static if are good at this point of view.
but standalone 'iftype' is too close to plain 'if'.

Just some thoughts aloud...

One more: probably this would be better:

static if cast ( TypeParameter ) Statement [else Statement]

?

Andrew.




"Walter" <newshound@digitalmars.com> wrote in message news:d6imvd$2c53$1@digitaldaemon.com...
> I'm not too sure about iftype. Let's see how it goes. Consider it 'experimental' for now.
>
> http://www.digitalmars.com/d/changelog.html
>
>
> 


May 20, 2005
"Jarrett Billingsley" <kb3ctd2@yahoo.com> wrote in message news:d6jhcv$2vlb$1@digitaldaemon.com...
> "Walter" <newshound@digitalmars.com> wrote in message news:d6imvd$2c53$1@digitaldaemon.com...
>
> Ooh, some nice new things to try out :)
>
> Something I've wondered though - will the .size ever bee just ignored?  It seems kind of redundant to have an error just for .size when it could just say "no member .size for blah."  I suppose the error is just there for porting older D code, but will this error be removed for 1.0?

Yes, it'll be removed. This is just a temporary thing to flush out any remaining older uses.


May 20, 2005
I'd also prefer a merge of "static if" and "iftype".  I quite like static if, myself.  I guess I'd push:

static if (bar isimplicit int)
static if (bar as T)
static if (bar as T isimplicit int)

Or something.  Just seems : is a bit overused for various meanings.

Also, it'd be great to have a way to (statically) check for the existance of a symbol (specifically a function or class):

static if (&funcname)

Or something.  The above actually seems to work, but only if it does exist.  Otherwise:

staticif.d(9): undefined identifier test2

Which is, quite specifically, what I'd like to avoid.  This would allow me to release bar, which depends on foo, but have bar able to use foo 1.0 or foo 2.0, depending on what it is compiled with.

-[Unknown]


> Seems like 'static if' and 'iftype' are the same statement.
> Difference is just in type of condition expression.
> 
> Is it possible to combine them together somehow and to have
> just one static if? (I personally prefer 'when' instead of 'static if' but anyway...
> 
> Currently in D, notation of 'if' statement is as:
> 
> IfStatement:
>     if ( Expression ) Statement [else Statement]
> 
> So if we will add:
>     static if ( Expression ) Statement [else Statement]
>     static if typeof ( TypeParameter ) Statement [else Statement]
> 
> then it will not break existing grammar.
> 
> Other forms of latter two productions using 'when':
> 
>     when ( Expression ) Statement [else Statement]
>     when typeof ( TypeParameter  ) Statement [else Statement]
> 
> I think that D should have clear "notational distance"
> between runtime and compile time constructions.
> static assert and static if are good at this point of view.
> but standalone 'iftype' is too close to plain 'if'.
> 
> Just some thoughts aloud...
> 
> One more: probably this would be better:
> 
> static if cast ( TypeParameter ) Statement [else Statement]
> 
> ?
> 
> Andrew.
> 
> 
> 
> 
> "Walter" <newshound@digitalmars.com> wrote in message news:d6imvd$2c53$1@digitaldaemon.com...
> 
>>I'm not too sure about iftype. Let's see how it goes. Consider it
>>'experimental' for now.
>>
>>http://www.digitalmars.com/d/changelog.html
May 20, 2005
Err, I guess I didn't meant static if (rather if), as iftype isn't necessarily static, I suppose.

-[Unknown]


> I'd also prefer a merge of "static if" and "iftype".  I quite like static if, myself.  I guess I'd push:
> 
> static if (bar isimplicit int)
> static if (bar as T)
> static if (bar as T isimplicit int)
> 
> Or something.  Just seems : is a bit overused for various meanings.
May 20, 2005
Can't types already be checked with normal if's (using TypeInfo, .typeof)? So why the iftype? or "static if typeof" or for that matter? Existing syntax should be used, if it can be  used.

Is it beacuse the result of .typeof is not known at compile time?

L.


May 20, 2005
> Can't types already be checked with normal if's (using TypeInfo, .typeof)?

In runtime (TypeInfo), yes. In compile time (typeof), no.
TypeInfo is an object in runtime, typeof  is a type name compile time.

> So why the iftype? or "static if typeof" or for that matter? Existing syntax should be used, if it can be  used.

Agreed, but it is not the case.

>
> Is it beacuse the result of .typeof is not known at compile time?

result of typeof(expression) is known at compile time (it is a compile time
function) but you cannot do almost anything useful with it.
typeof() evaluates to type name which is (type name) not a string
and not an object like TypeInfo.

int a;
typeof(1) a;

are eqiuvalent in D.

Andrew.

"Lionello Lunesu" <lio@lunesu.removethis.com> wrote in message news:d6jvgd$9gn$1@digitaldaemon.com...
> Can't types already be checked with normal if's (using TypeInfo, .typeof)? So why the iftype? or "static if typeof" or for that matter? Existing syntax should be used, if it can be  used.
>
> Is it beacuse the result of .typeof is not known at compile time?
>
> L.
>