Neil Jerram escreveu:
> 2008/9/2 Han-Wen Nienhuys <[EMAIL PROTECTED]>:
>> If you are doing memq? for something you already know to
>> somewhere in front of the list [...]
> 
> Why would you do that?  In two senses:
> 
> 1. I know memq gives you the tail of the list, but I usually use its
> result only as a true/false value Why would run use memq like that in
> a situation where you already know that it will give you true?
> 
> 2. It feels unusual to me to have a long list, but in which certain
> kinds of values are known always to be near the front.  That sounds
> like something that should really be represented as two (or more)
> separate lists.
> 
> Have you observed this (the current usage of SCM_VALIDATE_LIST) as a
> performance problem in practice?

No, but it feels strange to me that a function whose intrinsic function
does not require O(n) behavior, does require it in all cases.

However, I find Mikael's argument that it complicates programming a lot 
persuasive.

-- 
 Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen



Reply via email to