Re: unevaluated sequences of initially indefinite length and 'filter'

Steven D. Majewski (sdm7g@elvis.med.virginia.edu)
Thu, 17 Feb 1994 15:49:38 -0500

On Feb 17, 14:24, I wrote:
>
> I made to other changes:
> (1) If setlistitem() fails, filter now tries addlistitem() to append
> to the list. The fixes the attribute error problem.
>
> 134c134,135
> < if (setlistitem(result, j++, item) < 0)
> ---
> > if (setlistitem(result, j++, item) < 0) {
> > if ( addlistitem( result, item ) < 0 )
> 135a137
> > }
>

Maybe it makes more sense to save previous len, before updating len,
and compare that to j, than to wait for setlistitem() to fail, but:
Such are the ways of the Late-Night-Hack.

But then, this method has the benefit of not penalizing the folks who
aren't using this hack. ( Again: I credit Tim Peters ( and maybe a
little Icon influence ) with teaching me the creative use of failure!

Tim: In paraphrase of Grace Hooper's famous quote about it
sometimes being easier to apologize than to ask permission:
"It's sometimes easier to try/except than to ask permission" (??)

- Steve Majewski