On Tue, Oct 20, 2009 at 11:30 AM, Andrei Alexandrescu <seewebsiteforem...@erdani.org> wrote: > Steven Schveighoffer wrote: >> >> If your goal is to affect the original array, then you should accept a ref >> argument or not append to it. > > I think that's an entirely reasonable (and easy to explain) stance.
I've definitely spent time tracking down exactly such bugs, where I meant to make the argument a ref but didn't. If the above is to be the official stance, then I think it should be enforced by the compiler. Appending to non-ref slice args should be an error. --bb