Eliminate assert and lazy from D?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Oct 12 22:49:42 PDT 2009


Adam D. Ruppe wrote:
> On Mon, Oct 12, 2009 at 11:33:57PM -0500, Andrei Alexandrescu wrote:
>> Right now, the language has enough power to express assert as a library 
>> function, as opposed to a primitive construct. (See e.g. enforce.) I 
>> think it would be good to relegate assert to object.d.
> 
> What about static assert? Can it be moved to the library too?
> 
> If not, it seems kinda weird that assert() is just a lib function, but if
> you put static before it, it becomes a completely different thing.

That kinda takes the wind out of the sails of the "remove assert" ship.

>> I personally believe it's useful to be able to pass an unevaluated 
>> expression into a function, for example assert and enforce themselves 
>> use that.
> 
> I pretty rarely use it, but I'd be sad to see it go - it really does make
> a few things more elegant.
> 

Yah, me too, enforce in particular is a happy beneficiary.


Andrei



More information about the Digitalmars-d mailing list