You can use idx to store associations but it is slower for lower number of
elements. If i do things with idx they tend to be more messy.
Am 17.12.2016 04:53 schrieb "dean" <deangwillia...@gmail.com>:
> >'assoc'iation list for such purposes. That is probably the fastest, and
> surely most lispy :)
> Then that's what I should really be doing...I wasn't familiar with this
> but looking on the net it seems to involve "assoc" but I've also seen "idx"
> in the lists part of the reference.
> I think I "get" assoc
> : (assoc '(a) '(((a) vlu_a1 vlu_a2) ((a b).vlu_ab1))) #'(a) is the key for
> vlu_a1 and vlu_a2
> -> ((a) vlu_a1 vlu_a2)
> : (assoc '(a b) '(((a) vlu_a1 vlu_a2) ((a b).vlu_ab3))) #'(a b) is the key
> just for vlu_ab3
> -> ((a b) .vlu_ab3)
> but I can't see how the first few insertions in the example result in this
> (d (2 NIL 17 NIL A) (a b c)) # 'd' already existed
> and wonder
> a) if idx is a possible way of doing association lists and
> b) irrespective of the answer how the above tree comes from the insertions.
> Sorry if it's obvious and I've just missed it.
> Best Regards
> On 14 December 2016 at 19:31, Alexander Burger <a...@software-lab.de>
>> 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
>> > two lists at the same time, instead
>> > of sequentially.
>> Oops, you are right! I have not tested, but the 'pick' solution is
>> *slower* than the get/index one, due to the function call overhead for
>> I think I never needed such a case. Usually I try do build 'assoc'iation
>> for such purposes. That is probably the fastest, and surely most lispy :)
>> - Alex
>> UNSUBSCRIBE: mailto:email@example.com?subject=Unsubscribe