Re: +E/R and +Set
On Mon, Dec 09, 2019 at 06:53:29AM +0100, Alexander Burger wrote: > Yes. The standard way is to have one form, one search dialog, and one 'url>' > method per +Entity class, and handle +List's of other objects in a chart each. > > When that works, you can try to make cool nifty things like squeezing all > into a > single +ListTextField ;) Especially problematic is the recursive creation of task and task-name objects on the fly. This will create lots of garbage objects, as every misspell of a name results in a new object. In the normal way, with search dialogs, objects are created only when explicitly pressing the "New" button. ☺/ A!ex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: +E/R and +Set
On Sun, Dec 08, 2019 at 06:56:13PM -0800, C K Kashyap wrote: > Thanks Alex...I am going to get the +Chart route working first. When I > referred the past notes I found that I've had +Char working in the past - > albeit with less indirection :) Yes. The standard way is to have one form, one search dialog, and one 'url>' method per +Entity class, and handle +List's of other objects in a chart each. When that works, you can try to make cool nifty things like squeezing all into a single +ListTextField ;) ☺/ A!ex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: +E/R and +Set
Thanks Alex...I am going to get the +Chart route working first. When I referred the past notes I found that I've had +Char working in the past - albeit with less indirection :) Regards, Kashyap On Sun, Dec 8, 2019 at 1:05 PM Alexander Burger wrote: > On Sun, Dec 08, 2019 at 12:41:18PM -0800, C K Kashyap wrote: > > Could the problem be the "List" relation between Task and Tag? > > I think in general this relation is fine. I would just not try to handle > it in a > single swoop, i.e. all in a +ListTextField > > > > Also any suggestion about getting a "val> bad message" error in the > > "+Chart" approach? > > The chart approach is more clear and controllable. I suspect the chart > example I > sent back then had the same flaw as my proposal for the (: nm nm) and > 'request!' > approach. It either lacked one indirection or one listnig ('mapcar' or > 'exract') > level. Sorry, I lost overview meanwhile ;) > > Try to think trough it, I believe you are close! > > ☺/ A!ex > > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >
Re: +E/R and +Set
On Sun, Dec 08, 2019 at 12:41:18PM -0800, C K Kashyap wrote: > Could the problem be the "List" relation between Task and Tag? I think in general this relation is fine. I would just not try to handle it in a single swoop, i.e. all in a +ListTextField > Also any suggestion about getting a "val> bad message" error in the > "+Chart" approach? The chart approach is more clear and controllable. I suspect the chart example I sent back then had the same flaw as my proposal for the (: nm nm) and 'request!' approach. It either lacked one indirection or one listnig ('mapcar' or 'exract') level. Sorry, I lost overview meanwhile ;) Try to think trough it, I believe you are close! ☺/ A!ex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: +E/R and +Set
Even while leaving the field! Yes, you had mentioned it earlier but for some reason it slipped my mind that +Fmt was equivalent of +Set +Val... I just want to get this approach to a logical conclusion since I started out on it. Could the problem be the "List" relation between Task and Tag? : (setq T8 (db 'ttl '+Task "Item 8")) -> {51} : (print-task T8) Item 8: [BLUE, RED, ALL] -> "]" : (request! '(+Tag) 'tsk T8 'nm (request! '(+TagNm) 'nm "RED")) -> {55} : (print-task T8) Item 8: [RED, BLUE, RED, ALL] -> "]" : Also any suggestion about getting a "val> bad message" error in the "+Chart" approach? Regards, Kashyap On Sun, Dec 8, 2019 at 10:56 AM Alexander Burger wrote: > On Sun, Dec 08, 2019 at 10:15:54AM -0800, C K Kashyap wrote: > > 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. > > Not at all. As I wrote in the previous mail, these functions are called at > every > micro-transaction. > > > > is EXTREME overkill! You basically rewrite all task objects several > times > > > during any primitive GUI operation like key presses and refreshes. > > Just 'trace' stuff to see how much happens here :) > > Especially if JavaScript is enabled in your browser, these functions run > even > when leaving a field. > > > > Anyway, it is not clear to my why the code results in > > duplicate tags - but yes, feeling very optimistic :) > > Not clear to me either now. Perhaps due to the non-unique keys (I > mentioned in a > prev. mail)? Though 'request' will not create new ones all the time, just > not > clear *which* one it returns. > > ☺/ A!ex > > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >
Re: +E/R and +Set
On Sun, Dec 08, 2019 at 10:15:54AM -0800, C K Kashyap wrote: > 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. Not at all. As I wrote in the previous mail, these functions are called at every micro-transaction. > > is EXTREME overkill! You basically rewrite all task objects several times > > during any primitive GUI operation like key presses and refreshes. Just 'trace' stuff to see how much happens here :) Especially if JavaScript is enabled in your browser, these functions run even when leaving a field. > Anyway, it is not clear to my why the code results in > duplicate tags - but yes, feeling very optimistic :) Not clear to me either now. Perhaps due to the non-unique keys (I mentioned in a prev. mail)? Though 'request' will not create new ones all the time, just not clear *which* one it returns. ☺/ A!ex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: +E/R and +Set
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 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 >> >
Re: +E/R and +Set
> > 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 >
Unsubscribe
-- *-- Frantisek Fuka* (yes, that IS my real name) -- My personal homepage: www.fuxoft.cz -- My social feeds: www.fuxoft.cz/feed