Assoc & Lookup
Posted: Wed Aug 18, 2004 7:43 pm
Hello Lutz,
In the philosophy of Assoc and Lookup the search in nested-list have only the first element as 'key-index. In lists I think all elements are key-indexes
to eighother..thats more logical..? I know..there should be always and index
if more possebilites exist, but in that case always the first is returned.
Searching for the second or third value in a nested list could result
in the following..
(setq X '( ( 1 2 ) ( 3 4 ) ( 5 6 ) ( 7 8 9 ) ))
(assoc 8 X)
>( 7 8 9 )
(lookup 4 X)
> 3
(lookup 8 X)
> 7 true 9 or 7 9
(lookup 7 X)
> true 8 9 or 8 9
Regards, Norman.
In the philosophy of Assoc and Lookup the search in nested-list have only the first element as 'key-index. In lists I think all elements are key-indexes
to eighother..thats more logical..? I know..there should be always and index
if more possebilites exist, but in that case always the first is returned.
Searching for the second or third value in a nested list could result
in the following..
(setq X '( ( 1 2 ) ( 3 4 ) ( 5 6 ) ( 7 8 9 ) ))
(assoc 8 X)
>( 7 8 9 )
(lookup 4 X)
> 3
(lookup 8 X)
> 7 true 9 or 7 9
(lookup 7 X)
> true 8 9 or 8 9
Regards, Norman.