Re: +QueryChart without pilog

2019-12-06 Thread C K Kashyap
Awesome ... the +Val also has the good sideeffect that the UI is updated to upper case :) It's wonderful to gather these PicoLisp nuggets of wisdom!!! Thanks Alex. Regards, Kashyap On Fri, Dec 6, 2019 at 6:41 AM Alexander Burger wrote: > On Fri, Dec 06, 2019 at 03:24:25PM +0100, Alexander

Re: +QueryChart without pilog

2019-12-06 Thread Alexander Burger
On Fri, Dec 06, 2019 at 03:24:25PM +0100, Alexander Burger wrote: >(gui 'tags '(+Var +Val +ListTextField) > '*Tags > '((L) (extract '((X) (uppc (pack X))) L)) > '("," " ") > 20 ) Ah, and of course +ListTextField already returns a list of strings, so the 'pack' should

Re: +QueryChart without pilog

2019-12-06 Thread Alexander Burger
On Thu, Dec 05, 2019 at 07:11:43PM -0800, C K Kashyap wrote: > Okay, my choTask looks like this now - as you can see, I assigned a list > to @Names and then assigned the 'car' of the list to @Key. The way I > avoided repetition was by assigning to a global symbol '*Names' - is that > reasonable? >

Re: +QueryChart without pilog

2019-12-05 Thread C K Kashyap
Okay, my choTask looks like this now - as you can see, I assigned a list to @Names and then assigned the 'car' of the list to @Key. The way I avoided repetition was by assigning to a global symbol '*Names' - is that reasonable? "Tags" (gui 'tags '(+Var +ListTextField)

Re: +QueryChart without pilog

2019-12-05 Thread C K Kashyap
Super! .. thanks Alex, Regards, Kashyap On Thu, Dec 5, 2019 at 9:23 AM Alexander Burger wrote: > On Thu, Dec 05, 2019 at 08:34:34AM -0800, C K Kashyap wrote: > > About the "filtering with a no-op" - that was my way of getting rid of > > NIL's in the list - what's the right way :) ? > > Ah, yes,

Re: +QueryChart without pilog

2019-12-05 Thread Alexander Burger
On Thu, Dec 05, 2019 at 08:34:34AM -0800, C K Kashyap wrote: > About the "filtering with a no-op" - that was my way of getting rid of > NIL's in the list - what's the right way :) ? Ah, yes, sure! A valid solution! I just did not trigger on that pattern, because I use (filter prog Lst), or

Re: +QueryChart without pilog

2019-12-05 Thread C K Kashyap
Thanks Alex, About the "filtering with a no-op" - that was my way of getting rid of NIL's in the list - what's the right way :) ? Regards, Kashyap On Thu, Dec 5, 2019 at 7:50 AM Alexander Burger wrote: > Hi Kashyap, > > > The question I have now is about cases where we may need a couple of >

Re: +QueryChart without pilog

2019-12-05 Thread Alexander Burger
Hi Kashyap, > The question I have now is about cases where we may need a couple of pilog > variables of the form - > @Names XXX > @Gen (mapcan '((Nm) (list 'nm '+TagNm Nm)) 'XXX) > > where XXX needs to be substituted with an expression - (filter

Re: +QueryChart without pilog

2019-12-05 Thread C K Kashyap
Oh! ... now I see the spacing problem .. sorry about that, I think it must be the result of copying from the terminal and pasting. The last proposal was perfect - indeed it works just fine for tags (I've tried different pasting this time). (de choTask (Dst) (diaform '(Dst) (

Re: +QueryChart without pilog

2019-12-04 Thread Alexander Burger
On Wed, Dec 04, 2019 at 02:32:57PM -0800, C K Kashyap wrote: > (patch choTask 'XXX '(filter '((X) X) (mapcar '((X) (uppc (pack X))) > *Tags))) > ... I do not understand your intention. I thougt you wanted an AND of all tags, so the @Gen generator was obsolete. My last proposal was: (de f

Re: +QueryChart without pilog

2019-12-04 Thread Alexander Burger
Hi Kashyap, > (de choTask (Dst) > >(diaform > > '(Dst) > > ( > > "--" > > "Name" > > (gui > > 'ttl > > '(+DbHint +Var +TextField) > > '(ttl +Task) Hmm, OK, perhaps not to *that* extreme. 'pretty' was not a

Re: +QueryChart without pilog

2019-12-04 Thread C K Kashyap
Okay, I have a working version but I think I should be able to do it more elegantly. I have the complete choTask function below (pretty printed ofcourse :) ) I have the repeating pattern as XXX which I replace using patch - (patch choTask 'XXX '(filter '((X) X) (mapcar '((X) (uppc (pack X)))

Re: +QueryChart without pilog

2019-12-04 Thread C K Kashyap
Thanks Alex, Sure, I'll do a pp in future - also start following that conventions. About @Gen using @Names - the second argument of mapcan in the definition of @Gen is essentially @Names. I am looking for a way to avoid having to repeat the expression (filter ... (gui 'query

Re: +QueryChart without pilog

2019-12-04 Thread Alexander Burger
Hi Kashyap, On Tue, Dec 03, 2019 at 07:48:58PM -0800, C K Kashyap wrote: > I'll need a little bit more help with Pilog in QueryChart - In the code > below, Could you in the future provide code which is formatted in a more readable way? It is very hard to decipher. Better no spaces between lines,

Re: +QueryChart without pilog

2019-12-03 Thread C K Kashyap
Hi Alex, I'll need a little bit more help with Pilog in QueryChart - In the code below, I get the tags as a list of space separated words in the *Tags variable. I create the @Names and @Gen pilog variables using *Tags. As you can see @Gen uses @Names inside it but I am not sure how to reuse the

Re: +QueryChart without pilog

2019-11-29 Thread C K Kashyap
Oh yes! got it. Regards, Kashyap On Thu, Nov 28, 2019 at 11:10 PM Alexander Burger wrote: > On Thu, Nov 28, 2019 at 01:30:26PM +0100, Alexander Burger wrote: > >(de f (Names) > > (pilog > > (quote > > @Names Names > > @Gen (mapcan '((Nm) (list 'nm

Re: +QueryChart without pilog

2019-11-28 Thread Alexander Burger
On Thu, Nov 28, 2019 at 01:30:26PM +0100, Alexander Burger wrote: >(de f (Names) > (pilog > (quote > @Names Names > @Gen (mapcan '((Nm) (list 'nm '+TagVal Nm)) Names) > (select (@Item) >((@Gen (v +Tag) itm)) >

Re: +QueryChart without pilog

2019-11-28 Thread C K Kashyap
Super! Regards, Kashyap On Thu, Nov 28, 2019 at 8:39 AM Alexander Burger wrote: > On Thu, Nov 28, 2019 at 08:26:01AM -0800, C K Kashyap wrote: > > I think having the filter in lisp still lets us take > > advantage of +QueryChart's efficiency over large sets right? > > Yes, exactly. And it is

Re: +QueryChart without pilog

2019-11-28 Thread Alexander Burger
On Thu, Nov 28, 2019 at 08:26:01AM -0800, C K Kashyap wrote: > I think having the filter in lisp still lets us take > advantage of +QueryChart's efficiency over large sets right? Yes, exactly. And it is faster than pure Pilog ;) ☺/ A!ex -- UNSUBSCRIBE:

Re: +QueryChart without pilog

2019-11-28 Thread C K Kashyap
Thank you so much Alex, This works for me! I think having the filter in lisp still lets us take advantage of +QueryChart's efficiency over large sets right? Regards, Kashyap On Thu, Nov 28, 2019 at 4:37 AM Alexander Burger wrote: > On Thu, Nov 28, 2019 at 11:45:23AM +0100, Alexander Burger

Re: +QueryChart without pilog

2019-11-28 Thread Alexander Burger
On Thu, Nov 28, 2019 at 11:45:23AM +0100, Alexander Burger wrote: >(de f (Names) > (pilog > (quote > @Names Names > @Gen (mapcan '((C) (list 'nm '+TagVal C)) Names) > (select (@Item) >((@Gen (v +Tag) itm)) >(lst

Re: +QueryChart without pilog

2019-11-28 Thread Alexander Burger
Oops, wait! On Thu, Nov 28, 2019 at 10:56:56AM +0100, Alexander Burger wrote: >(de f (Names) > (pilog > (quote > @Names Names > @Gen (mapcan '((C) (list 'nm '+TagVal C)) Colors) > (select (@Item) >((@Gen (v +Tag) itm)) >

Re: +QueryChart without pilog

2019-11-28 Thread Alexander Burger
On Thu, Nov 28, 2019 at 10:44:15AM +0100, Alexander Burger wrote: > I would prepare the generator clauses as a Pilog variable, to build them at > runtime, and then use the member/2 predicate in the filter clause to check for > membership in the list of colors. Could not resist :) This works:

Re: +QueryChart without pilog

2019-11-28 Thread Alexander Burger
Hi Kashyap, > Hurray!!! :) > Just to confirm if I've understood correctly - this solution is similar > to (nm +CuSu @Sup (sup +Item) (itm +Pos) ord) from the sample app correct? > Instead of (nm +CuSu @Sup) we have (nm +TagVal @Col1 nm +TagVal) - right? Yes, similar. The +CuSu case does: 1.

Re: +QueryChart without pilog

2019-11-27 Thread C K Kashyap
Hurray!!! Thank you so much Alex, Just to confirm if I've understood correctly - this solution is similar to (nm +CuSu @Sup (sup +Item) (itm +Pos) ord) from the sample app correct? Instead of (nm +CuSu @Sup) we have (nm +TagVal @Col1 nm +TagVal) - right? I need one more help - writing a function

Re: +QueryChart without pilog

2019-11-26 Thread Alexander Burger
On Tue, Nov 26, 2019 at 02:06:25PM -0800, C K Kashyap wrote: > It seems to work as expected using collects :) Here's the complete program > - it prints out ITEM1 and ITEM6 as expected. Ah, right, you select items, not tags, and items have a *list* of tags. OK. Then to get AND, you can instead of

Re: +QueryChart without pilog

2019-11-26 Thread C K Kashyap
Hey Alex, It seems to work as expected using collects :) Here's the complete program - it prints out ITEM1 and ITEM6 as expected. (call "rm" "-f" "test.db") (class +Item +Entity) (rel ttl (+IdxFold +String)) (rel tgs (+List +Joint) itm (+Tag)) (rel sts (+IdxFold +String)) (class +Tag +Entity)

Re: +QueryChart without pilog

2019-11-26 Thread Alexander Burger
On Tue, Nov 26, 2019 at 01:13:09PM -0800, C K Kashyap wrote: > Hey Alex, > What I need is an "and" - with collects, I do a (sect of L1 L2) ... I tried > a bunch but cant seem to get "and" working - > I need the items that are "RED" and "BLUE" :( Hmm, isn't that impossible? In your model, a tag

Re: +QueryChart without pilog

2019-11-26 Thread C K Kashyap
Hey Alex, What I need is an "and" - with collects, I do a (sect of L1 L2) ... I tried a bunch but cant seem to get "and" working - I need the items that are "RED" and "BLUE" :( Perhaps I have to adjust the ER to achieve this? regards, Kashyap On Tue, Nov 26, 2019 at 7:42 AM C K Kashyap wrote: >

Re: +QueryChart without pilog

2019-11-26 Thread C K Kashyap
Thanks Alex, I'll try it out. Regards, Kashyap On Mon, Nov 25, 2019 at 11:24 PM Alexander Burger wrote: > Hi Kashyap, > > > Here's a new problem - as per the previous conversation, it seems that I > > could use "collect" to get the items that I am interested in. > > > > (let (RED (db 'nm

Re: +QueryChart without pilog

2019-11-25 Thread Alexander Burger
Hi Kashyap, > Here's a new problem - as per the previous conversation, it seems that I > could use "collect" to get the items that I am interested in. > > (let (RED (db 'nm '+TagVal "RED") > BLUE (db 'nm '+TagVal "BLUE")) > (setq L1 (collect 'v '+Tag RED RED 'itm)) > (setq L2