On Tue, 24 Jan 2012 15:02:33 -0500, Andrei Alexandrescu
<[email protected]> wrote:
On 1/24/12 2:53 PM, Steven Schveighoffer wrote:
On Sun, 22 Jan 2012 10:27:42 -0500, Andrei Alexandrescu
<[email protected]> wrote:
byKey is what, an adverb phrase, an adjective phrase? It can't name a
range which is a thing.
It has the implied verb "enumerate", "span". "Span hashtable by key".
Actually, it's for each (x) in (y) by key:
I'm thinking independently of foreach, e.g.
auto iter = aa.byKey/*()*/;
This should clarify that iter spans aa by key.
I wrote about that.
auto iter = aa enumerate (or span) by key.
But it doesn't actually enumerate by calling that function. The
enumeration is done by iter, which is an enumerator/spanner/iterator.
FWIW, I think byKey or byValue is fine for a name. We're not writing
COBOL here, it can be shorthand. I just think they are properties, and
read in English as nouns/adjectives (not actions).
-Steve