Replacing new? (was re: -nogc)

Daniel Keep daniel.keep.lists at gmail.com
Thu Apr 23 15:25:44 PDT 2009



Andrei Alexandrescu wrote:
> Joel C. Salomon wrote:
>> Just as (1) & (2) point to a way to remove the “magic” of built-in
>> arrays & hash-tables, so too might (5) & (6) point to a way of replacing
>> the “new T(args)” syntax with something cleaner?  Not that
>> “new!(T)(args)” looks nicer than the current syntax, but is it perhaps a
>> better fit with the rest of the language?
> 
> I agree. new sucks.
> 
> Andrei

Oh I don't know, I rather like being able to allocate stuff on the heap.
 I mean, if I didn't, the poor heap would probably be very lonely.

Poor, poor oft-maligned heap; all because he's a bit slower than stack
allocation and needs to be cleaned up after.  He's trying to help, you know!

Joking aside, what do you have in mind?  Every solution I come up with
ends up being more or less the same (except with the 'new' keyword in a
different place) or worse.

  -- Daniel



More information about the Digitalmars-d mailing list