Boost logo

Boost :

From: Matt Austern (austern_at_[hidden])
Date: 2001-11-14 12:41:59


Bill Seymour wrote:
>
> Beman wrote:
> >
> > The only real technical issue I can remember being mentioned
> > was a question as to why the design had chosen eager rather
> > than lazy evaluation.
> >
>
> I don't remember that one; but maybe I was taking a biology
> break at the time. 8-)
>
> Regardless of the rationale for eager evaluation (IIRC, to
> avoid overflow as much as possible), should that really be
> an issue? It seems like a QoI issue that wouldn't go into
> the Standard anyway.

Not necessarily. Consider, for example, the difference
between list<> and vector<>. There are a few syntactic
differences (you can write v.begin() + 5, and you can't
do it with l.begin()), but those are minor, and could
easily have been eliminated. The real differences are
in the complexity of operations. The difference between
an O(1) and O(N) operation is so important that it's
effectively part of the interface.

Andrei Alexandrescu argued that the difference between
eager and lazy evaluation was something similar. He did
not argue that one was better than the other; he argued
that for some applications lazy evaluation made no sense
and that for other applications eager evaluation made no
sense, that a rational number package must document which
strategy it uses, and perhaps that the strategy should be
user-selectable.

                        --Matt


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk