On 15 March 2012 17:51, Manu <turkey...@gmail.com> wrote: > On 15 March 2012 19:05, Andrei Alexandrescu <seewebsiteforem...@erdani.org> > wrote: >> >> On 3/15/12 11:30 AM, Manu wrote: >>> >>> On 15 March 2012 17:32, Andrei Alexandrescu >>> <seewebsiteforem...@erdani.org <mailto:seewebsiteforem...@erdani.org>> >>> >>> wrote: >>> One note - the code is really ingenious, but I still prefer swap() >>> in this case. It's more concise and does less work in the general >>> case. >>> >>> swap(a[i + k], a[j + j]); >>> >>> only computes the indexing once (in source, too). >>> >>> >>> It all still feels to me like a generally ugly hack around the original >>> example: >>> a,b = b,a; >> >> >> It's a function call. Why is a function call a ugly hack? > > > Because now we're involving libraries to perform a trivial assignment. >
Question, what benefits would (a, b = b, a) bring over swap(a, b) if it was included? -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';