ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Picolisp latest found at http://www.software-lab.de/down.html | check also http://www.picolisp.com for more information
_whitelogger has joined #picolisp
<u0_a183> N3k0 : I wouldn't know the proper way but "cut" seems to destructively slice a list. see: https://software-lab.de/doc/refC.html#cut
<u0_a183> there is a "copy" builtin function if you want original list kept intact https://software-lab.de/doc/refC.html#copy
<N3k0> i was looking at copy, but missed cut, thanks for the tip :)
karswell_ has quit [Ping timeout: 264 seconds]
<aw-> N3k0: (let S '(1 2 3 4 5 6) (make (while S (link (cut 2 'S))))
<u0_a183> that's pretty slick, that must be the right way to do it
<N3k0> yeah thats pretty smooth, thanks a lot
<aw-> (let S (1 2 3 4 5 6) ... would have also worked
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
orivej has joined #picolisp
<N3k0> last question for today: is teh picolisp guaranteed to return data in the same order as it was inserted, or will have i have to sort stuff?
<N3k0> picolisp database*
<N3k0> got some time series data that shouldnt get all twisted around
<Regenaxer> All objects in the DB are independent and have no guaranteed order. You use indexes (B-Trees) to access them, and thus you get them in the order of the keys
<N3k0> so if i +Key the timestamp relation then its OK?
<Regenaxer> yes, if the values are unique. Otherwise +Ref
<Regenaxer> u0_a183: btw, 'cut' is not destructive in the sense it is used in the docs
<Regenaxer> ie. it does not modify the list, only the variable
<N3k0> Okay then that case im all good. thanks for the help :)
<Regenaxer> Welcome! :)
<Regenaxer> afp
styx has joined #picolisp
alexshendi has quit [Ping timeout: 256 seconds]
pierpal has quit [Ping timeout: 264 seconds]
styx has quit [Quit: styx]
andyjpb has quit [Quit: Leaving.]
alexshendi has joined #picolisp
viaken has quit [Ping timeout: 276 seconds]
pierpal has joined #picolisp
<Regenaxer> ret
orivej has quit [Ping timeout: 244 seconds]
grp has joined #picolisp
alexshendi has quit [Ping timeout: 264 seconds]
viaken has joined #picolisp
grp has quit [Ping timeout: 244 seconds]
grp has joined #picolisp
sriram has joined #picolisp
<sriram> hi...still experimenting with the resize of canvas....it seems that the resize does not destroy the timer because at least once timer event occurs after the resize
<Regenaxer> Hi :)
<Regenaxer> I see!
<sriram> so was hoping could learn more about the redirect we spoke about yesterday
<sriram> Hi :)
<sriram> and how to accomplish it
<Regenaxer> But this one event may be sent by the old instance perhaps?
<sriram> I waited to get at least two timer events before resizing again...
<Regenaxer> I thought about the same redirect you use in 'work'
<sriram> just to make sure :)
<Regenaxer> But it looks wrong
<Regenaxer> (using redirect)
<sriram> ah yes...saw it..but not sure wher eto add it :)
grp has quit [Ping timeout: 268 seconds]
<Regenaxer> Normally, if I need to reload a page in the normal (non-JS) GUI, I call (url *Url) in a button press
<Regenaxer> But here is all JS
<Regenaxer> and rather un-picolispish
<Regenaxer> Not sure what goes on behind the screens
<sriram> yes..i had to do a lot in js to accomplish the resize
<Regenaxer> I would not do that
<sriram> resize the parent div when the parent form size changes (on resize) and update canvas width and height
<Regenaxer> rather just get the size, and then redraw all the normal way
<sriram> ah yes..much better...just set the size of the parent div...but not update canvas size?
<Regenaxer> I don't know
<sriram> but canvas size is specified only once when creating the form
<Regenaxer> yes
<Regenaxer> and when we have a new size, make it new
<sriram> yes..i do call setCanvasSize from JS....
<Regenaxer> not set size
<Regenaxer> just make a new canvas perhaps
orivej has joined #picolisp
<Regenaxer> I always avoided such size changes ;)
<sriram> check if size is different from before and then call (redirect (baseHRef) *SesId "!canvasTest") in setCanvasSize
<sriram> (i think cannot avoid on phone due to orientation :) )
<Regenaxer> yes, but make it new
<Regenaxer> you determine the size initially anyway
<sriram> make it new? sorry...not sure what is meant :) delete old canvas and create it new? in picolisp?
<Regenaxer> The whole pagi
<Regenaxer> page
<Regenaxer> the whole view
<sriram> yes...so just call canvasTest again...it remakes with the new canvasSize
<sriram> is that not?
<sriram> perhaps (url "!canvasTest")
<sriram> instead of redirect?
<Regenaxer> where in the code do you determine the screen size?
<sriram> it is done on the js side...then js calls (setCanvasSize W H) to set the new width and height
<Regenaxer> I mean to change the whole flow
<sriram> right now (setCanvasSize W H) does nothing more than update the globals
<Regenaxer> I would do it on the Lisp level *before* any page is drawn
<Regenaxer> as part of the page routine
<sriram> but perhaps it could check if size has changed and just call canvasTest again which uses the new values of the globals to recreate the canvas
<Regenaxer> onresize would post a new state
<Regenaxer> triggering a new start of the page
<Regenaxer> Hmm, it all looks wrong to me and far too complicated
<Regenaxer> Your code is awfully long
<Regenaxer> mostly debug prints
<Regenaxer> so I can't find anything ;)
<Regenaxer> And lots of still irrelevant stuff
<Regenaxer> I think 'onload' should determine the size and simply draw
<Regenaxer> When the device is rotated or resize, I expect a new onload
<Regenaxer> It can't be so complicated
<sriram> :) i agree may be inefficiently done...i commented the (msg (glue...debug prints on each function now to simplify...
<sriram> maximize/unmaximize does not seem to generate onload...but onresize
<Regenaxer> ok
<sriram> onload seems to work ok...by calling drawCanvas
<sriram> canvas width and height is set in JS
<sriram> what is the difference between (url "someurl") and (redirect ...."someurl")
<Regenaxer> (redirect ) runs in a GET typically I would say
<Regenaxer> It really redirects the browser
<sriram> so perhaps that is what i want here when size changes...rather than (url "!canvasTest")
<Regenaxer> (url ) sends *another* page than the current one back in a response to POST
<sriram> oh so i do want url
<sriram> because it is a new page with a different canvas size
<Regenaxer> (url ) is good if you trigger a post in the onresize event
<Regenaxer> yes
<sriram> (how to trigger a post in the on resize event is my next question :) )
<Regenaxer> using lisp()
<sriram> right now in onresize i just update the sizes....but now i must also trigger a post
<Regenaxer> with a form argument
<sriram> oh i see...
<Regenaxer> function lisp(form, fun) {
<Regenaxer> ...
<sriram> and the form is actually the node id of the fieldset? or is it the form node itself?
<Regenaxer> return post(form, false, exe, null);
<sriram> (yes i saw it in gis.l)
<Regenaxer> yeah
<Regenaxer> you use the form of a component
<sriram> yes...i have the node id of the fieldset anyway to get the size of the form
<sriram> but then i can use fieldset.form to get the form itself
<Regenaxer> (gui '(+OnClick +Button)
<Regenaxer> "var t = new Date();
<Regenaxer> return lisp(this.form, 'setTime',
<Regenaxer> t.getHours(), t.getMinutes(), t.getSeconds() )"
<Regenaxer> "Now!" )
<Regenaxer> Usually just 'this' in JS
<Regenaxer> this.form
<Regenaxer> But here we have no component
<sriram> that is for buttons and other input components
<Regenaxer> yeah
<sriram> but i found that a div does not have a form field
<Regenaxer> right
<sriram> but no problem...i get it from the fieldset
<Regenaxer> lisp() goes to a form used in the pil gui
<Regenaxer> It is all tailored for a pil GUI ;)
<sriram> and already i do lisp(null, 'setCanvasSize', W, H)
<sriram> so will just add the form as the first argument
<Regenaxer> lisp(null, might be fine too
<Regenaxer> it triggers a GET
<sriram> yes i saw that the setCanvasSize was being called anyway
<Regenaxer> which seems also OK for your purpose
<sriram> so i removed the form previously :)
grp has joined #picolisp
<sriram> so to put it all together :)
<Regenaxer> I'm not sure what is the best way here
<sriram> lisp (null, fnName, .....triggers a GET --> in this case combine with redirect in the fnName
<Regenaxer> yes, GETs the new page
<sriram> lisp(form, fnName ...... triggers a post -> in this case combine with url inside fnName
<sriram> i.e (url "newUrl")
<Regenaxer> BTW, I'm travelling tomorrow morning
<Regenaxer> until Thursday
<Regenaxer> not sure if I'll be online occasionally
<sriram> ah ok .... np :)
<sriram> in any case...i think it must be late at your end...dont want to take up your weekend evening....thank you for the ideas...:)
<sriram> will try both options and let you know how it goes
<Regenaxer> OK, good :)
<Regenaxer> Good luck! There must be a simple way
<sriram> if it works this seems not too complex to me ...but in any case just experimenting and learning...:)
grp has quit [Ping timeout: 265 seconds]
grp has joined #picolisp
alexshendi has joined #picolisp
sriram has quit [Ping timeout: 252 seconds]
grp has quit [Ping timeout: 248 seconds]
grp has joined #picolisp
grp has quit [Ping timeout: 268 seconds]
grp has joined #picolisp
styx has joined #picolisp
karswell_ has joined #picolisp
alexshendi has quit [Quit: Leaving]
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
grp has quit [Ping timeout: 240 seconds]
styx has quit [Quit: styx]
grp has joined #picolisp
grp has quit [Quit: box shutting down...]