http://d.puremagic.com/issues/show_bug.cgi?id=5076


Andrej Mitrovic <andrej.mitrov...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrov...@gmail.com


--- Comment #13 from Andrej Mitrovic <andrej.mitrov...@gmail.com> 2012-02-07 
12:20:02 PST ---
I run into this issue all the time, in particular when doing script-based
programming. E.g.:

string[string] classes;
foreach (name; classes.keys.sorted) { } // ng

Having to do this is a chore:
auto keys = classes.keys;
sort(keys);
foreach (name; keys) { } 

This works ok for my purposes (yada yada about constraints):
T sorted(T)(T t)
{
    T result = t;
    sort(result);
    return result;
}

Why do we have replace and replaceInPlace, whereas we have sort which sorts in
place implicitly? "findSkip" is another function that I sometimes use but I
hate how it hides the fact that it modifies its arguments. "find" returns a
range, but "findSkip" returns a bool and *modifies* your argument. It's not at
all obvious from the call site.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to