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)
                (<grid> "--"
                     "Name" (gui 'ttl '(+DbHint +Var +TextField) '(ttl
+Task) '*Name 20)
                     "Tags" (gui 'tags '(+Var +ListTextField) '*Tags
'(","," ") 20)
                     (searchButton '(init> (: home query)))
                 )
                (gui 'query '(+QueryChart) *ROWS
                   '(goal
                     '(
                         @Names (filter '((X) X) (mapcar '((X) (uppc (pack
X)))  *Tags))
                         @Key (car (filter '((X) X) (mapcar '((X) (uppc
(pack X))) *Tags)))
                         (select (@@)
                          ((nm +TagNm @Key (nm +Tag) tsk))
                          (^ @
                           (fully
                            '((Nm)
                                (find
                                 '((This) (member Nm (: nm nm)))
                                 (; (-> @@) tgs) ) )
                            (-> @Names) ) )


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 '((X) X)
(mapcar '((X) (uppc (pack X)))  *Tags))) in this case. As I was
experimenting for writing this email, using function calls to do the
"substitution" seems to work. For some reason, it was not working for me
when I tried yesterday.

This seems to work too -
'(
   @Names (YY)
   @Gen (mapcan '((Nm) (list 'nm '+TagNm Nm)) '(YY T))
   (select (@@)
    ((@Gen (nm +Tag) tsk))
    (^ @
     (fully
      '((Nm)
          (find
           '((This) (member Nm (: nm nm)))
           (; (-> @@) tgs) ) )
      (-> @Names) ) )
   )
)

where YY is defined as -
(de YY (QT)
    (filter '((X) X) (mapcar '((X) (uppc (pack X)))  *Tags)))

One thing odd I find is that the code "does not work" when I call YY with
NIL or without an argument in the second case (@Gen)

I think I'll have to do some more experiments to come up with precise
questions. In the meantime, the tags logic works for me :)


Regards,
Kashyap



On Wed, Dec 4, 2019 at 10:53 PM Alexander Burger <a...@software-lab.de>
wrote:

> 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 (Names)
>    (pilog
>       (quote
>          @Names Names
>          @Key (car Names)
>          (select (@Item)
>             ((nm +TagVal @Key (v +Tag) itm))
>             (^ @
>                (fully
>                   '((Nm)
>                      (find
>                         '((This) (member Nm (: v nm)))
>                         (; (-> @Item) tgs) ) )
>                   (-> @Names) ) ) ) )
>       (print-item @Item) ) )
>
>    (f '("RED" "BLUE"))
>
> What was wrong with it?
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>

Reply via email to