This seems to work fine...
(setq I '(() (a) (a b)))
(setq V '(empty a_vlu ab_vlu))

(de vlu4key (Vlu 'I 'V)
    (setq Ix (index Vlu I))
    (get V Ix) )


? (setq K '(a))
-> (a)
? (vlu4key K I V)
-> a_vlu
? (setq K '(a b))
-> (a b)
? (vlu4key K I V)
-> ab_vlu

On 13 December 2016 at 10:58, dean <deangwillia...@gmail.com> wrote:

> Ok...I'm going to just going to use a list of lists for the index and a
> list of values i.e. two separate variables.
>
> On 12 December 2016 at 15:37, dean <deangwillia...@gmail.com> wrote:
>
>> Having thought about this I was intending to use the SAME list variable
>> to represent multiple property keys i.e. as I type keys (to traverse a menu
>> tree) I was hoping to use the key "trail" at any point (stored as a list)
>> as a unique key.
>>
>> Having now realised what == means...it looks like pointer equivalence
>> rules this approach out and I'm just wondering if there is a way around
>> this...
>>
>> Any thoughts much appreciated
>> Best Regards
>> Dean
>>
>> On 12 December 2016 at 08:51, dean <deangwillia...@gmail.com> wrote:
>>
>>> Thank you for the clarification.
>>>
>>> On 12 December 2016 at 06:19, Alexander Burger <a...@software-lab.de>
>>> wrote:
>>>
>>>> Hi Dean,
>>>>
>>>> > On 11 December 2016 at 20:06, Alexander Burger <a...@software-lab.de>
>>>> wrote:
>>>> >
>>>> > > On Sun, Dec 11, 2016 at 07:05:13PM +0000, dean wrote:
>>>> > > > but I'd like a list of letters to be a single key.
>>>> > > > Is this not possible?
>>>> > > Properties are handled (searched) by pointer-equality, the '=='
>>>> function.
>>>>
>>>> I should have mentioned that you can indeed use non-symbolic keys in
>>>> other
>>>> contexts, like 'assoc', 'idx' (and 'cache') and of course database
>>>> indexes.
>>>>
>>>> - Alex
>>>> --
>>>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>>>>
>>>
>>>
>>
>

Reply via email to