This one works much better :) "Tags" (gui '(+E/R +Fmt +ListTextField) '(tgs : home obj) '((L) (mapcar '((This) (: nm nm)) L)) # Set function '((L) (mapcar '((Nm) (request! '(+Tag) 'tsk (: home obj) 'nm (request! '(+TagNm) 'nm Nm))) L) ) # Val function '(","," ") 40 )
The unwanted side effect though is that the number of tags keeps doubling. Looks like the Val function is called both when the "edit" button is clicked and when "done" button is pressed. While I expected it to be called when the "done" button was pressed but I am not sure why it is called when "edit" is pressed. Anyway, it is not clear to my why the code results in duplicate tags - but yes, feeling very optimistic :) Regards, Kashyap On Sun, Dec 8, 2019 at 6:57 AM C K Kashyap <ckkash...@gmail.com> wrote: > As we have a list of strings, isn't simply just 'mapcar' fine again? I >> cannot >> test, but something like: >> >> '((L) >> (mapcar >> '((Nm) >> (request! '(+Tag) >> 'nm (request! '(+TagNm) 'nm Nm ) ) ) >> L ) ) >> >> > Yes indeed ... having the expression return L fixes the "Not a List > issue". The request! did not quite work (as expected) since the Tag it > returns would not have the appropriate task set. I tested it in the REPL > and this works perfectly - > > (request! '(+Tag) 'tsk (db 'ttl '+Task "Item 8") 'nm (request! '(+TagNm) > 'nm "PURPLE")) > If I could just get a way to get the Task in the val function, this would > work great! > > Regards, > Kashyap > > > >> -- >> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >> >