== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article > I personally find this much more pleasant: > auto numAdded = lengthChain(a).add(1,2,3).add(b).add(c [1..3]).delta; > than: > int numAdded = void; > with(a) > { > auto olength = length; > add(1,2,3); > add(b); > add(c[1..3]); > numAdded = length - olength; > }
But if add just returns the delta rather than the reference then it's just: with (a) numAdded = add(1,2,3) + add(b) + add(c[1..3]); // (I'm hoping 'with' works like this! Can't test here) or numAdded = a.add(chain([1,2,3], b, c[1..3]); (I'm assuming b was a range here, otherwise you could just add it to the end of the first expression).