www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Better C++?

reply "Frustrated" <c1514843 drdrb.com> writes:
Is that not just C+++? When the gc and allocation gets fixed
we'll end up with C++++?

Then don't we have D = C^n for some n? Does this hold for
negative numbers? Complex numbers?
Feb 14 2014
next sibling parent "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Fri, Feb 14, 2014 at 07:28:33PM +0000, Frustrated wrote:
 Is that not just C+++? When the gc and allocation gets fixed
 we'll end up with C++++?
 
 Then don't we have D = C^n for some n? Does this hold for
 negative numbers? Complex numbers?

I have enough trouble imagining C^n for irrational n, nevermind negative numbers or complex numbers! T -- Some ideas are so stupid that only intellectuals could believe them. -- George Orwell
Feb 14 2014
prev sibling next sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Fri, 14 Feb 2014 14:28:33 -0500, Frustrated <c1514843 drdrb.com> wrote:

 Is that not just C+++? When the gc and allocation gets fixed
 we'll end up with C++++?

No, C+++ isn't valid, and I don't know about C++++, but I'm suspecting no. The next generation would be C+=2 :P -Steve
Feb 14 2014
prev sibling next sibling parent "Jeremy DeHaan" <dehaan.jeremiah gmail.com> writes:
On Friday, 14 February 2014 at 20:11:19 UTC, Steven Schveighoffer
wrote:
 On Fri, 14 Feb 2014 14:28:33 -0500, Frustrated 
 <c1514843 drdrb.com> wrote:

 Is that not just C+++? When the gc and allocation gets fixed
 we'll end up with C++++?

No, C+++ isn't valid, and I don't know about C++++, but I'm suspecting no. The next generation would be C+=2 :P -Steve

(++C)++ It looks silly, but it's valid in D!
Feb 14 2014
prev sibling next sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Fri, 14 Feb 2014 15:23:50 -0500, Jeremy DeHaan  
<dehaan.jeremiah gmail.com> wrote:

 On Friday, 14 February 2014 at 20:11:19 UTC, Steven Schveighoffer
 wrote:
 On Fri, 14 Feb 2014 14:28:33 -0500, Frustrated <c1514843 drdrb.com>  
 wrote:

 Is that not just C+++? When the gc and allocation gets fixed
 we'll end up with C++++?

No, C+++ isn't valid, and I don't know about C++++, but I'm suspecting no. The next generation would be C+=2 :P -Steve

(++C)++ It looks silly, but it's valid in D!

Maybe valid, but what message is it sending?! C+=2 is much more efficient ;) -Steve
Feb 14 2014
prev sibling next sibling parent "Jeremy DeHaan" <dehaan.jeremiah gmail.com> writes:
On Friday, 14 February 2014 at 20:26:02 UTC, Steven Schveighoffer
wrote:
 On Fri, 14 Feb 2014 15:23:50 -0500, Jeremy DeHaan 
 <dehaan.jeremiah gmail.com> wrote:

 On Friday, 14 February 2014 at 20:11:19 UTC, Steven 
 Schveighoffer
 wrote:
 On Fri, 14 Feb 2014 14:28:33 -0500, Frustrated 
 <c1514843 drdrb.com> wrote:

 Is that not just C+++? When the gc and allocation gets fixed
 we'll end up with C++++?

No, C+++ isn't valid, and I don't know about C++++, but I'm suspecting no. The next generation would be C+=2 :P -Steve

(++C)++ It looks silly, but it's valid in D!

Maybe valid, but what message is it sending?! C+=2 is much more efficient ;) -Steve

My original idea was to be (C++)++, which makes sense conceptually, but wasn't valid code. :P
Feb 14 2014
prev sibling next sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Fri, 14 Feb 2014 15:27:46 -0500, Jeremy DeHaan  
<dehaan.jeremiah gmail.com> wrote:

 My original idea was to be (C++)++, which makes sense
 conceptually, but wasn't valid code. :P

Actually, it doesn't make sense. C++ increments C, but returns the value that C was before the increment. So it returns a temporary. Incrementing a temporary is not allowed (where would the incremented value go?), and even if it were allowed, would likely not be what you want ;) ++++C may be valid, but is butt-ugly. C+=2 is just far superior on all fronts! -Steve
Feb 14 2014
prev sibling parent "Asman01" <jckj33 gmail.com> writes:
On Friday, 14 February 2014 at 19:28:34 UTC, Frustrated wrote:
 Is that not just C+++? When the gc and allocation gets fixed
 we'll end up with C++++?

 Then don't we have D = C^n for some n? Does this hold for
 negative numbers? Complex numbers?

I don't what number n would be but the n for C++++ give C#... we need a number positive greater than this. :)
Feb 14 2014