Uh... destructors?

%u wfunction at hotmail.com
Wed Feb 23 09:17:15 PST 2011


>> It seems that you're using the word "pure" as a synonym for the noalias and/or restrict __declspec keywords. However, they're different words because they have
different meanings. :) If you really mean noalias, then I think we just just call it that and introduce the attribute @noalias? Otherwise, it's a misuse of the term
"pure", because D doesn't seem to be really using the term for its correct purpose.

> Don't know what those keywords are, but pure functions in the academic sense are discernible from weak-pure functions via the parameters and return values.

They're Microsoft-specific keywords. From MSDN:
"noalias means that a function call does not modify or reference visible global state and only modifies the memory pointed to directly by pointer parameters (first-level
indirections).
"If a function is annotated as noalias, the optimizer can assume that, in addition to the parameters themselves, only first-level indirections of pointer parameters are
referenced or modified inside the function. The visible global state is the set of all data that is not defined or referenced outside of the compilation scope, and their
address is not taken."


This is _clearly_ what D is calling "pure", and because of the fact that "pure" is such a misnomer and that noalias is (almost?) clearly what we mean, I suggest we use the
latter term instead... does this sound like a good idea?


More information about the Digitalmars-d mailing list