Vlu above misleads a bit because it represents Key...or K below (setq I '(() (a) (a b))) (setq V '(empty a_vlu ab_vlu)) (de vlu4key (K 'I 'V) (get V (index K I)))
On 13 December 2016 at 11:35, dean <[email protected]> wrote: > 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 <[email protected]> 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 <[email protected]> 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 <[email protected]> wrote: >>> >>>> Thank you for the clarification. >>>> >>>> On 12 December 2016 at 06:19, Alexander Burger <[email protected]> >>>> wrote: >>>> >>>>> Hi Dean, >>>>> >>>>> > On 11 December 2016 at 20:06, Alexander Burger <[email protected]> >>>>> 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:[email protected]?subject=Unsubscribe >>>>> >>>> >>>> >>> >> >
