Complexity nomenclature

ZombineDev via Digitalmars-d digitalmars-d at puremagic.com
Tue Dec 8 01:58:26 PST 2015


On Monday, 7 December 2015 at 16:15:46 UTC, Andrei Alexandrescu 
wrote:
>
> These are still expressible without a DSL: 
> BigO(Atom("array[].walkLength") + Atom("r.walkLength")) etc.
>

We can remove the use of strings if we tag walkLength with BigO:

// this:
BigO(Atom("array[].walkLength") + Atom("r.walkLength"))

//become this:
@(complexity!(array[].walkLength) + complexity!(r.walkLength))

Or if we rename complexity to bigO:

@(bigO!(array[].walkLength) + bigO!(r.walkLength))



More information about the Digitalmars-d mailing list