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?
>
> ....
> "Tags" (gui 'tags '(+Var +ListTextField) '*Tags '("," " ") 20 )
> (searchButton '(init> (: home query))) )
> (gui 'query '(+QueryChart) *ROWS
> '(goal
> '(@Names (setq *Names (filter prog (mapcar '((X) (uppc (pack X)))
> *Tags)) )
> @Key (car *Names)
Yes, this works, but I agree that using a global does not feel right.
I would suggest to handle it directly in the GUI
...
"Tags"
(gui 'tags '(+Var +Val +ListTextField)
'*Tags
'((L) (filter prog (mapcar '((X) (uppc (pack X))) L)))
'("," " ")
20 )
...
so that '*Tags' immediately has the filtered uppercase values.
Also, we can avoid mapping the list twice (mapcar and then filter). 'extract' is
intended for such cases:
(gui 'tags '(+Var +Val +ListTextField)
'*Tags
'((L) (extract '((X) (uppc (pack X))) L))
'("," " ")
20 )
☺/ A!ex
--
UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe