assert() vs. enforce(), invariant() vs. ... ?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Aug 31 14:30:41 PDT 2013


On 8/31/13 1:34 PM, Brian Rogoff wrote:
> On Friday, 30 August 2013 at 21:11:32 UTC, Andrei Alexandrescu wrote:
>> * scope: cute and dangerous in equal proportions - great for a movie
>> character, terrible for language design.
>
> I'll argue for it and others can then destroy.
>
> IME, a lot of the value of functional programming (by which I mean,
> programming with higher order functions) can be had with downward
> funargs, as found in Pascal (and more recently, Ada), which don't
> require garbage collection.
>
> The D language expresses closures and higher order functions as
> delegates, and uses the heap to manage these. I had assumed that we
> could use 'scope' on the delegate being passed to prevent it's heap
> allocation, as discussed here:
>
> http://stackoverflow.com/questions/4711309/meaning-of-scope-in-d-for-a-parameter

That use will stay and is useful and uncontested.

Andrei



More information about the Digitalmars-d mailing list