Jump to page: 1 25  
Page
Thread overview
Deprecating C style casts
May 05, 2004
Walter
May 05, 2004
Roel Mathys
May 05, 2004
C
May 05, 2004
Jeroen van Bemmel
May 05, 2004
imr1984
May 05, 2004
Andy Friesen
May 05, 2004
Chr. Grade
May 05, 2004
Ivan Senji
May 05, 2004
Andy Friesen
May 05, 2004
Chr. Grade
May 05, 2004
Chris Lawson
May 05, 2004
Chr. Grade
May 05, 2004
Chris Lawson
May 05, 2004
Chr. Grade
May 05, 2004
Chris Lawson
May 05, 2004
Matthew
May 05, 2004
Chr. Grade
May 05, 2004
Matthew
May 05, 2004
Chr. Grade
May 06, 2004
J C Calvarese
May 05, 2004
Lars Ivar Igesund
May 05, 2004
Andy Friesen
May 05, 2004
Walter
May 16, 2004
Ilya Minkov
May 05, 2004
James McComb
May 05, 2004
Ivan Senji
May 05, 2004
Mark T
May 05, 2004
Matthew
May 05, 2004
Walter
May 05, 2004
Andy Friesen
May 05, 2004
Walter
May 06, 2004
C. Sauls
May 09, 2004
Hauke Duden
May 11, 2004
Walter
May 11, 2004
C. Sauls
May 18, 2004
Walter
May 05, 2004
J C Calvarese
May 05, 2004
Patrick Down
May 05, 2004
Russ Lewis
May 06, 2004
chris
May 06, 2004
Scott Egan
May 06, 2004
J Anderson
May 06, 2004
Mike Wynn
May 18, 2004
Brad Anderson
May 24, 2004
Walter
May 05, 2004
Currently, D supports C style casts:

    (type)expression

as well as D style casts:

    cast(type)expression

The C style casts are tricky to parse right, and I think will cause increasing problems down the road due to the syntactical ambiguities with it. The D style cast has no such problems, and it has the advantage of being greppable (as some programming styles consider an explicit cast to be a bug, and being able to find and check them all to be a Good Thing).

What do people think about first deprecating, then removing, the C style cast?


May 05, 2004
Walter wrote:
> Currently, D supports C style casts:
> 
>     (type)expression
> 
> as well as D style casts:
> 
>     cast(type)expression
> 
> The C style casts are tricky to parse right, and I think will cause
> increasing problems down the road due to the syntactical ambiguities with
> it. The D style cast has no such problems, and it has the advantage of being
> greppable (as some programming styles consider an explicit cast to be a bug,
> and being able to find and check them all to be a Good Thing).
> 
> What do people think about first deprecating, then removing, the C style
> cast?
> 
> 

just do it,
D has no intention of compiling C code, and it will certainly mark the spots where something funny is going on

roel
May 05, 2004
Walter wrote:
> What do people think about first deprecating, then removing, the C style
> cast?

+1

-- 
Julio César Carrascal Urquijo
http://jcesar.f2o.org/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS$ d- s+:+ a-- C++> ULS++ P++ L+> !E W+++ N+ o? K? w++>
O---@ M V? PS+ PE Y+ PGP t+ 5- X+++@ R- tv+(++) b++> DI!
D++> G e+> h-- r- y+
------END GEEK CODE BLOCK------
May 05, 2004
Yea rip em out there.  I vote yes, take away C style casts.

C

On Wed, 5 May 2004 10:04:08 -0700, Walter <newshound@digitalmars.com> wrote:

> Currently, D supports C style casts:
>
>     (type)expression
>
> as well as D style casts:
>
>     cast(type)expression
>
> The C style casts are tricky to parse right, and I think will cause
> increasing problems down the road due to the syntactical ambiguities with
> it. The D style cast has no such problems, and it has the advantage of being
> greppable (as some programming styles consider an explicit cast to be a bug,
> and being able to find and check them all to be a Good Thing).
>
> What do people think about first deprecating, then removing, the C style
> cast?
>
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
May 05, 2004
please do

deprecate in the next release, remove in the one after that. Fix is trivial enough to warrant such a short period

"Walter" <newshound@digitalmars.com> wrote in message news:c7b6vn$1o0h$1@digitaldaemon.com...
> Currently, D supports C style casts:
>
>    (type)expression
>
> as well as D style casts:
>
>    cast(type)expression
>
> The C style casts are tricky to parse right, and I think will cause
> increasing problems down the road due to the syntactical ambiguities with
> it. The D style cast has no such problems, and it has the advantage of
> being
> greppable (as some programming styles consider an explicit cast to be a
> bug,
> and being able to find and check them all to be a Good Thing).
>
> What do people think about first deprecating, then removing, the C style cast?
>
> 


May 05, 2004
i dont see what's wrong with C style casts. Exactly how would this proposal reduce my D-coding bugs?

In article <c7b6vn$1o0h$1@digitaldaemon.com>, Walter says...
>
>Currently, D supports C style casts:
>
>    (type)expression
>
>as well as D style casts:
>
>    cast(type)expression
>
>The C style casts are tricky to parse right, and I think will cause increasing problems down the road due to the syntactical ambiguities with it. The D style cast has no such problems, and it has the advantage of being greppable (as some programming styles consider an explicit cast to be a bug, and being able to find and check them all to be a Good Thing).
>
>What do people think about first deprecating, then removing, the C style cast?
>
>


May 05, 2004
imr1984 wrote:

> i dont see what's wrong with C style casts. Exactly how would this proposal
> reduce my D-coding bugs?

I don't think it will.

What it will do is make the compiler simpler, and the language easier to parse.  That means that the compiler will be faster, and code analyzing tools will be better.

 -- andy
May 05, 2004
Walter wrote:

> What do people think about first deprecating, then removing, the C style
> cast?

+1

D-style casts: great. C-style casts: lame.
May 05, 2004
The closer D will remain related to C and Cpp, the more likely people are willing to have a closer look at D and programm with it and switch to it. D has to be intuitive for D-newbies. I merely tried D because it looked and felt so familiar.
I'd be more than disencouraged if C/Cpp style casts were missing, because I'm simply used to them; I like them.

> 
> I don't think it will.
> 
> What it will do is make the compiler simpler, and the language easier to parse.  That means that the compiler will be faster, and code analyzing tools will be better.
> 
>  -- andy
May 05, 2004
"Walter" <newshound@digitalmars.com> wrote in message news:c7b6vn$1o0h$1@digitaldaemon.com...
> What do people think about first deprecating, then removing, the C style cast?

+1


« First   ‹ Prev
1 2 3 4 5