https://d.puremagic.com/issues/show_bug.cgi?id=10959
--- Comment #6 from [email protected] 2014-01-09 03:11:59 PST --- In Python to remove an item from an array (list) you use: >>> items = [10, 20, 30, 20] >>> items.remove(20) >>> items [10, 30, 20] With D+Phobos you need: void main() { import std.stdio, std.algorithm; auto items = [10, 20, 30, 20]; items = items.remove(items.countUntil(20)); items.writeln; } So this API is quite bad all around, it's not just bug-prone. So I suggest to introduce a differently named function that works similarly to the current remove (but it doesn't need the bug-prone re-assignment on the left): items.removeAtIndex(1); And modify remove() to work like this, as the Python remove method: items.remove(20); -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
