MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

Re: Wrong



On Sun, 17 Mar 1996, Hans Friedrich-- wrote:

> old=callers(@args);
> old=listdelete(old, length(old));
> new={};
> for x in (old)
>   if (x[3..5] != {"", #-1, #-1})
>     new={@new, x};
>   endif
> endfor
> return new;

I goofed when I first wrote this code.  Replace the first two lines:

> old=callers(@args);
> old=listdelete(old, length(old));

with:

old=callers()[2..$];

(Which deletes the *first* element of the callers(), list, instead of the 
first.)

If you use it the way I wrote it originally, you'll eliminate all 
built-ins, but the first element of the return value will be the call to 
:old_callers, and what should be the last element of the return will be 
missing.

Thus are the dangers of writing even the simplest code late at night 
without checking it very carefully illustrated.  Sorry.

  --Chris                           cunkel@engin.umich.edu
    ResComp Network Support Technician, Bursley Hall
    "Invisibility is in the eye of the beholder."
    Home Page: http://www-personal.engin.umich.edu/~cunkel/



References:

Home | Subject Index | Thread Index