Ok thank you for that
On 16 December 2016 at 21:02, Joh-Tob Schäg wrote:
> Maybe can hepl you with that it inserts 15 numbers with different keys and
> prints the result after each insert or at least it should. Could not try it
Maybe can hepl you with that it inserts 15 numbers with different keys and
prints the result after each insert or at least it should. Could not try it
Ok there won't be many associations in this instance so thank you for the
advice.
I'd still like to understand how that idx tree hierarchy gets formed from
what looks like a load of "homogenous" insertions (suggesting linear to
me) and how d gets to be first in a sorted tree i.e. before the number
assoc '(a) '(((a) vlu_a1 vlu_a2) ((a b).vlu_ab1))) #'(a) is the key
(vlu_a1 vlu_a2 ) to be exact. Since ((a) vlu_a1 vlu_a2) is ((a) . (vlu_a1
vlu_a2))
Am 17.12.2016 04:53 schrieb "dean" :
> >'assoc'iation list for such purposes. That is probably the fastest, and
> surely most lispy :)
>
> Then tha
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" :
> >'assoc'iation list for such purposes. That is probably the fastest, and
> surely most lispy :)
>
> Then that's what I sho
>'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" as
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 i
@Alex
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 trav
Great!thank you very much indeed!
Best Regards
Dean
On 14 December 2016 at 08:03, Alexander Burger wrote:
> On Wed, Dec 14, 2016 at 07:18:42AM +, dean wrote:
> > : (setq LstA (chop 'dOg))
> > -> ("d" "O" "g")
> > : (pick '((Ch) (and (= Ch (uppc Ch)) Ch)) LstA)
> > -> "O"
> >
> > but wond
On Wed, Dec 14, 2016 at 07:18:42AM +, dean wrote:
> : (setq LstA (chop 'dOg))
> -> ("d" "O" "g")
> : (pick '((Ch) (and (= Ch (uppc Ch)) Ch)) LstA)
> -> "O"
>
> but wonder if there's a slicker way?
Yes:
: (find upp? (chop "dOg"))
-> "O"
- Alex
--
UNSUBSCRIBE: mailto:picolisp@software-l
>Sorry, that was too cryptic :)
No...it was fine thanks to the last example in your documentation and
mention of multiple lists.
I wasn't sure about anonymous functions and wrote a named function so
showing how to do anonymous ones is very helpful. The next stage is to find
the first (and hopefully
On Tue, Dec 13, 2016 at 09:27:27PM +0100, Alexander Burger wrote:
> On Tue, Dec 13, 2016 at 08:58:23PM +0100, Alexander Burger wrote:
> > Instead, I recommend 'pick' where you pass the two lists.
>
> Sorry, that was too cryptic :)
>
> I think of something like:
>
>(pick '((A B) (and (= A Val
Hi Alex
I changed those 'Key 'Keys and 'Fn_to_call shortly after posting.
There'll also be a 3rd list call 'Args.
Because there are numerous associated bits and pieces they seem a good
candidate for an object.
Thank you for "pick" and the above corrections.
Best Regards
Dean
On 13 December 2016 a
On Tue, Dec 13, 2016 at 08:58:23PM +0100, Alexander Burger wrote:
> Instead, I recommend 'pick' where you pass the two lists.
Sorry, that was too cryptic :)
I think of something like:
(pick '((A B) (and (= A Value)) B) LstA LstB)
- Alex
--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subjec
Hi Dean,
> (setq I '(() (a) (a b)))
> (setq V '(empty a_vlu ab_vlu))
> (de vlu4key (K 'I 'V)
This is fatal! A function needs a list of *symbols*, not expressions like 'I ;)
> > (de vlu4key (Vlu 'I 'V)
> > (setq Ix (index Vlu I))
> > (get V Ix) )
Using 'index' to find an element and then
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 wrote:
> This seems to work fine...
> (setq I '(() (a) (a b)))
> (setq V '(empty a_vlu ab_vlu)
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 wr
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 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 tr
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 e
Thank you for the clarification.
On 12 December 2016 at 06:19, Alexander Burger wrote:
> Hi Dean,
>
> > On 11 December 2016 at 20:06, Alexander Burger
> wrote:
> >
> > > On Sun, Dec 11, 2016 at 07:05:13PM +, dean wrote:
> > > > but I'd like a list of letters to be a single key.
> > > > Is t
Hi Dean,
> On 11 December 2016 at 20:06, Alexander Burger wrote:
>
> > On Sun, Dec 11, 2016 at 07:05:13PM +, 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 shoul
Hi Alex
Thank you very much for explaining that.
Best Regards
Dean
On 11 December 2016 at 20:06, Alexander Burger wrote:
> On Sun, Dec 11, 2016 at 07:05:13PM +, dean wrote:
> > In the tutorial '(X Y Z) in a get statement seemed to refer to several
> keys
> > but I'd like a list of letters to
On Sun, Dec 11, 2016 at 07:05:13PM +, dean wrote:
> In the tutorial '(X Y Z) in a get statement seemed to refer to several keys
> but I'd like a list of letters to be a single key.
> Is this not possible?
>
> (setq X "")
> (put 'X '(D E) 'some_value)
> : (get 'X '(D E))
>-> NIL
Properties
In the tutorial '(X Y Z) in a get statement seemed to refer to several keys
but I'd like a list of letters to be a single key.
Is this not possible?
(setq X "")
(put 'X '(D E) 'some_value)
: (get 'X '(D E))
-> NIL
24 matches
Mail list logo