Book in the works by Alexander Stepanov
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Fri Sep 5 23:01:12 PDT 2008
See http://www.stepanovpapers.com/eop/eop.pdf for an interesting read.
The school of thought put forth by Stepanov resolves the recent
digitalmars.d debate on interface design (e.g. whether opIndex should be
part of a list interface) by favoring designs that define primitive
efficient operations from which others, potentially less efficient, can
be derived. On pages 5-6:
"A computational basis for a type is a finite set of procedures that
enable the construction of any other procedure on the type. A basis is
efficient if and only if any procedure implemented using it is as
efficient as an equivalent procedure written in terms of an alternative
basis. For example, a basis for unsigned 32-bit integers providing only
zero, equality, and the successor function is not efficient since the
implementation of addition in terms of successor is linear."
Andrei
More information about the Digitalmars-d-announce
mailing list