www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - iftype

reply bobef <bobef_member pathlink.com> writes:
I just thought this morning would't be something like

if (var istype int)

more reasonable than

iftype (var : int)
May 22 2005
next sibling parent reply "Walter" <newshound digitalmars.com> writes:
"bobef" <bobef_member pathlink.com> wrote in message
news:d6pg4l$1i12$1 digitaldaemon.com...
 I just thought this morning would't be something like

 if (var istype int)

 more reasonable than

 iftype (var : int)
But it isn't var:int, it's type:int. Nevertheless, my dissatisfaction with iftype is it's a separate statement. I think you're right in that it ought to be an expression.
May 22 2005
next sibling parent bobef <bobef_member pathlink.com> writes:
In article <d6phum$1j4m$1 digitaldaemon.com>, Walter says...
"bobef" <bobef_member pathlink.com> wrote in message
news:d6pg4l$1i12$1 digitaldaemon.com...
 I just thought this morning would't be something like

 if (var istype int)

 more reasonable than

 iftype (var : int)
But it isn't var:int, it's type:int.
I meant it is variable type :)
Nevertheless, my dissatisfaction with iftype is it's a separate statement. I
think you're right in that it ought to be an expression.
This is my point too.
May 22 2005
prev sibling parent "Craig Black" <cblack ara.com> writes:
A little off topic here, but I think that the static if and iftype (however 
it is implemented) are awesome features!  I am so impressed with the 
progress of D.  Good job, Walter!  Good job, D community!  Keep it up.

-Craig 
May 23 2005
prev sibling parent "Ben Hinkle" <ben.hinkle gmail.com> writes:
"bobef" <bobef_member pathlink.com> wrote in message 
news:d6pg4l$1i12$1 digitaldaemon.com...
I just thought this morning would't be something like

 if (var istype int)

 more reasonable than

 iftype (var : int)
what about the iftype ( foo bar : baz) syntax? I've been using the simple form iftype(foo : baz) up to now but keeping that general form would be nice.
May 22 2005