Hi Bruno,

> I'm surprised that (pick '((A B) (and (= A Value) B)) ListA ListB) is
> faster than (get ListB (index Value ListA)).

> It's true that get traverses ListB right after a traversal of ListA, but
> pick seems to do the same traversal of
> the same number of elements. The only difference is that pick traverses the
> two lists at the same time, instead
> of sequentially.

Oops, you are right! I have not tested, but the 'pick' solution is probably
*slower* than the get/index one, due to the function call overhead for each
element.

I think I never needed such a case. Usually I try do build 'assoc'iation list
for such purposes. That is probably the fastest, and surely most lispy :)

- Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to