From: Alexandre F. <ale...@gm...> - 2008-01-31 22:03:50
|
On 1/31/08, Jeff Hobbs <je...@ac...> wrote: > Alexandre Ferrieux wrote: > > > > > > Now: since this happens on a rather contorted case, why not just > > detect it (objv[2,3]==objv[1]) and take the protective steps only in > > that case ? > > What are the correct steps? Extrapolate for all possible values ... you > get different errors in various cases, and a real result in others. What I meant was the following: if ((objv[1]==objv[2])||(objv[1]==objv[3])) { /* do the anti-shimmering copy, essentially * just incrementing the listRep's refcount */ } else { tclListType.setFromAnyProc(interp,objv[1]); listPtr=objv[1] } /* the rest as is */ The idea of course is that the "else" above covers 99.9% of uses of lrange. -Alex |