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
styx has quit [Ping timeout: 264 seconds]
orivej has quit [Ping timeout: 248 seconds]
pierpa has quit [Quit: Page closed]
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
rob_w has joined #picolisp
orivej has joined #picolisp
mtsd has joined #picolisp
orivej has quit [Ping timeout: 260 seconds]
<aw-> hi all
<tankf33der> o/
<aw-> I'm looking for a cleaner way to format some code.. I have a long function that looks like: (let (A "a" B "b") ... some code (let (C "c" D "d") ... more code (let (E "e" F "f") ... more code )))
<aw-> could split into separate functions
<tankf33der> scary
<aw-> tankf33der: indeed
<aw-> it's a bunch of nested (let ()...
orivej has joined #picolisp
<Regenaxer> Sometimes hard to decide whether to factor or not
<aw-> hmmm
<aw-> ok I refactored into separate functions, thanks
<aw-> bbl
<Regenaxer> :)
<aw-> Regenaxer: is this considered dangerous or inefficient: (de my-fun (Arg) ... ) (if (eval my-fun) (do-something) (do-something-else))
<aw-> correction: (eval 'my-fun)
<Regenaxer> hmm, (eval 'my-fun) is the same as my-fun, ie the value
<Regenaxer> What do you intend?
<aw-> want to see if my-fun exists
<aw-> if it's defined
<Regenaxer> (getd 'my-fun)
<Regenaxer> So in your case it could be (if my-fun (do-something) ...
<aw-> ah! perfect!!
<Regenaxer> But (getd 'my-fun) is better, more strict
<aw-> i'm passing it as a unevaluated argument though.. i think (getd) is better
<Regenaxer> yeah
<aw-> hmmm.. maybe (fun?) would work too
<aw-> ok i'll see.. this is good though, thanks!
<Regenaxer> I think getd is best here
<Regenaxer> it does some more checks
<Regenaxer> fun? is the internal workhorse, if you know already that you have a symbol and the definition is already loaded
<Regenaxer> (fun? my-fun) is then (getd 'my-fun)
karswell_ has joined #picolisp
mtsd has quit [Quit: Leaving]
karswell_ is now known as karswell
orivej has quit [Ping timeout: 248 seconds]
orivej has joined #picolisp
styx has joined #picolisp
styx has quit [Ping timeout: 260 seconds]
styx has joined #picolisp
sriram_ has joined #picolisp
<sriram_> Hi...while tracing, I saw svg> +PdfWin $177457310674677 : T 0 NIL NIL
<sriram_> so was attempting to call it explicitly as follows (svg> $177457310674677 T 0 NIL NIL)
<Regenaxer> yes, but you must quote it
<Regenaxer> (svg> '$17...
<sriram_> but that gives an error: (+PdfWin) -- Symbol expected
<sriram_> oh i see
<Regenaxer> right
<Regenaxer> you pass the value
<Regenaxer> which is the list of classes
<sriram_> ah i see : $177457310674677 gives -> (+PdfWin)
<Regenaxer> T
<sriram_> the value of an object then is its list of classes?
<Regenaxer> correct
<Regenaxer> also called the "type"
<sriram_> here I do not wish to pass the value, as that will lose the info about the object itself
<Regenaxer> as opposed to a single class
<sriram_> I want to pass the message to the object, so I quote it
<Regenaxer> yep
<Regenaxer> so that in the end what svg> receives is the object $xxx
<Regenaxer> as shown by trace
<sriram_> good..now i can see how the output of svg> changes depending on the text in the rectangle....by simply calling the method
<sriram_> by the way, the panel on the right allows me to type text on different lines
<Regenaxer> you mean the TinyMCE text area?
<sriram_> but when i do apply, it all goes on the same line in rectangle. was that the intent? is it possible to "wrap" it so it does not fall out of rectangle
<sriram_> yes...in PdfPage app
<Regenaxer> not sure, I don't remember
<Regenaxer> It should go to separate lines
<sriram_> ok...was just an aside...no matter..seemed that the new lines are being lost
<sriram_> on apply
<sriram_> newlines
<Regenaxer> Should be preserved
styx has quit [Ping timeout: 264 seconds]
<sriram_> Hi\nHow are you yields Hi How are you in rectangle
<Regenaxer> I just tried
<sriram_> (i dont type the \n explicitly...but hit enter in the text box)
<Regenaxer> entering 2 lines gives 2 lines in the rect
<Regenaxer> Did you properly install tinymce?
<Regenaxer> also for the fonts etc?
<sriram_> I dont even recall installing tinymce
<sriram_> but there is a lib/tinymce.l
<Regenaxer> Without it pdfPage does not make much sense
<Regenaxer> yis
<Regenaxer> yes
<Regenaxer> there are instructions in that file iirc
<sriram_> so I must have installed
<sriram_> also the output of svg> shows the newlines
<sriram_> ah maybe reload java
<sriram_> no that doesnt help...checking tinymce instructions
<Regenaxer> lib/tinymce.l is always there, it is in the pil distro
<sriram_> In the application's runtime directory, create a link to the tinymce installation, e.g.: $ ln -s /some/path/tinymce/js/tinymce tinymce
<Regenaxer> I used tinymce_4.1.7.zip
<sriram_> maybe i missed this step
<Regenaxer> ah
<sriram_> oh i did not do the get and unzip step also
<sriram_> 2 min
<Regenaxer> I hope the versions of tinymce did not change too much
<Regenaxer> I think you can also do apt install tinymce
<sriram_> to get the tinymce, I get it from downloads dir?
<Regenaxer> not sure
<sriram_> ok..trying to locate the zip file
<Regenaxer> wait
<Regenaxer> I have it also here: software-lab.de/tinymce_4.1.7.zip
<sriram_> great will do wget
<Regenaxer> The debian version seems older:
<Regenaxer> $ apt list tinymce
<Regenaxer> Listing... Done
<Regenaxer> tinymce/testing,unstable 3.4.8+dfsg0-2 all
<Regenaxer> So just take tinymce_4.1.7 :)
<sriram_> done :
<sriram_> done :)
<Regenaxer> :)
<sriram_> doing link now
<sriram_> retrying
<sriram_> ./pil misc/pdfPage.l -main -"trace 'svg> '+PdfWin" -go +
<sriram_> I put the link to tinymce in . instead of ./misc
<sriram_> no change still
<Regenaxer> I have it directly in the runtime directory, no link
<Regenaxer> But a link works too
<Regenaxer> @lib/tinymce.l does: (javascript "@tinymce/tinymce.min.js"
<Regenaxer> So this file must be found
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
<sriram_> i had made a mistake...link and dir had same name :)
<sriram_> so renamed dir to Tinymce
<sriram_> and remade link
<sriram_> now retying
<Regenaxer> If you have it local, just omit the link
<sriram_> now it works fine
<sriram_> I even see the buttons in text area for text color et
<Regenaxer> Great!
<sriram_> I did not see them before
<Regenaxer> yeah
<Regenaxer> in the BlitzMenu demo probably you saw it
<sriram_> dont recall...but probably was there :) the whole look of that panel changed after the tinymce
<sriram_> including the font
<Regenaxer> right, it is important
<sriram_> If I am just doing the rectangle statically...i.e with no user ability to change any color or font or tect
<sriram_> text
<Regenaxer> I use this also in production code
<sriram_> perhaps I do not need the tinymce
<Regenaxer> not sure, I think the format of the text from the area is not right then
<sriram_> hmmm.. (svg> '$177226067223240 T 0 NIL NIL) now gives 1906 SIG-11
<sriram_> it was working before
<sriram_> and I checked the object is valid, got it from the trace
<Regenaxer> I new process? The old symbol is gone
<Regenaxer> ah
<sriram_> svg> +PdfWin $177226067223240 : T 0 NIL NIL
<sriram_> svg> +PdfWin $177226067223240 = 258
<sriram_> so the object is there
<Regenaxer> ok
<Regenaxer> yep
<sriram_> retried...(copy paste....now it works :) )
<Regenaxer> strange
<Regenaxer> Must be something with the env
andyjpb has joined #picolisp
<Regenaxer> I don't remember whether svg> makes sense only in a certain runtime context
<sriram_> the output of the svg> goes to image file (temporary) and then it is loaded into the canvas?
<sriram_> no
<sriram_> perhaps it is output from the html> method
<Regenaxer> in mk.svg it goes directly
<Regenaxer> html> is not used here iirc
<Regenaxer> But (ht:Out *Chunked (svg> Page (; Page zoom)))
<sriram_> yes from mk.svg
<sriram_> ?
<Regenaxer> T
<sriram_> but that svg> does not produce the entire window...just the left hand panel
<Regenaxer> the page
<sriram_> so was wondering how that is setup...i.e how is it setup so that mk. svg of the page gets called..?
<Regenaxer> it is passed as an URL
<Regenaxer> in drawPage
<sriram_> ah yes..just saw that
<sriram_> csDrawImage first generates the image via mk.svg and then does additional output.. In th case of drawPage the additional output is dots and selection etc
<Regenaxer> yes
<sriram_> ok good..I think I understand it little better now :) ...Now to study the generated svg for the rectangle...
<Regenaxer> :)
styx has joined #picolisp
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
styx has quit [Quit: styx]
alexshendi has joined #picolisp
alexshendi has quit [Ping timeout: 256 seconds]
singaraiona has joined #picolisp
singaraiona has quit [Client Quit]
alexshendi has joined #picolisp
orivej has quit [Ping timeout: 240 seconds]
<Regenaxer> Normally I set to /away then, but this time I forgot
grp has joined #picolisp
andyjpb has quit [Ping timeout: 276 seconds]
<Regenaxer> Ah, haha, sorry
<Regenaxer> yes, please :)
<Regenaxer> Was not watching here ^_^
<Regenaxer> Easier than to pack+unpack a mail, no hassle with attachments etc.
<sriram_> sure ..i will try with the pastebin i was using couple of days ago...should be easy at your end too :)
<Regenaxer> yes, https://pastebin.com
<sriram_> please try penyacom.org/p?q=bHdkR1I
<sriram_> (pastebin requires me to create an account)
<Regenaxer> really? I never registered there
<sriram_> oh interesting..will try again..
<Regenaxer> Perfect, got it
<Regenaxer> I always just copy/paste into the text area and press "Create paste"
<Regenaxer> anyway, np
<sriram_> (good ..pastebin works too..not sure what i did wrong the other day :) )
<Regenaxer> also good :)
<Regenaxer> in fact, penyacom.org seems better
<sriram_> in what way?
<Regenaxer> The text appears directl as with "raw" in pastebin
<Regenaxer> I always click "raw" first, then do S in w3m to save to a file
<Regenaxer> then view it with vip
<Regenaxer> ok
<Regenaxer> hmm, what may be the problem?
<sriram_> ah good...can continue using it then
<Regenaxer> yeah :)
<sriram_> the symptom is that when i connect to the port
<sriram_> the tile is not displayed
<sriram_> i was hoping to see a rectangle created (mk.svg) and then the tile
<sriram_> (square with letter A)
<Regenaxer> Is it modelled after pdfPage?
<sriram_> so this was my simple test for doing csDrawImage + mk.svg + some additional drawing
<sriram_> yes...i took the mk.svg from pdfPage, removed the svg> command
<sriram_> and directly did some prins
<sriram_> (based on the output of the svg>)
<sriram_> I also tool the csDrawImage code from drawPage...and used it to draw the tile in the additional commands)
<sriram_> I executed drawImage at the repl by itself (make (drawImage)) and it seems to give correct output
<sriram_> so thats why stuck now
<Regenaxer> hmm
<Regenaxer> Did you trace it to see how far it goes?
<sriram_> the only thing was the mk.svg url is probably called on a post, so I put a csPost in the drawImage...
<sriram_> traceAll?
<Regenaxer> only the relevant functions
<sriram_> ./pil draw2Rects.l -traceAll +
<sriram_> oh i see..maybe just drawImage
<Regenaxer> canvasTest is reached?
<Regenaxer> Then it shows an empty canvas?
<sriram_> let me do -"trace canvasTest"
<Regenaxer> needs quote btw
<Regenaxer> Does '((onload . "drawCanvas('$testID', -1)") as arg to 'html' work?
<sriram_> the error penyacom.org/p?q=NG1ZYVg
<sriram_> it used to ....I did not change that part...
<Regenaxer> A always use (javascript NIL "onload=drawCanvas(' ...
<Regenaxer> ok
<sriram_> I think I got that from the canvas demo page
<Regenaxer> ok
<Regenaxer> drawCanvas looks fine
<sriram_> i put a link to the error
<sriram_> penyacom.org/p?q=NG1ZYVg
<sriram_> oh maybe I should do trace 'canvasTest ?
<Regenaxer> No, I said you need to quote
<Regenaxer> ... let me do -"trace 'canvasTest"
<sriram_> when I do ./pil draw2Rects.l -"trace 'canvasTest" +
<sriram_> i can see canvasTest being called
<Regenaxer> ok
<sriram_> I think i need a post somewhere so that mk.svg url is called
<sriram_> or maybe it is called by csDrawImage
<sriram_> I added a csPost in hopes that it would fix it but perhaps not in correct place
<sriram_> drawImage called too
<Regenaxer> hmm, hard to tell here from just looking, and I'm not free at the moment to dig into it deeper
<Regenaxer> (sitting here with family)
<sriram_> ah sorry!
<sriram_> perhaps we can continue later...I will try digging
<sriram_> for a bit longer
<Regenaxer> Perhaps you can simplify
<sriram_> to see if I can find anything
<Regenaxer> and then grow bottom-up?
<sriram_> I thought this was the bare code to do the csDrawImage + mk.svg and then some additional drawing
<sriram_> I could remove commands from drawTile but
<Regenaxer> yeah
<sriram_> this is likely not the source of issue
<Regenaxer> Let me look at it tomorrow
<sriram_> but I can try that
<sriram_> sure...np..thanks
<sriram_> and talk to you tomorow...
<Regenaxer> :)
<sriram_> bye :)
<Regenaxer> yes, that's best!
<Regenaxer> no hurry I hope
<sriram_> not at all
<sriram_> slowly experimenting :)
<Regenaxer> I'm afp now :)
<Regenaxer> T
<Regenaxer> Good night! :)
<sriram_> yes evening now for you ...good night :)
<Regenaxer> :)
sriram_ has quit [Ping timeout: 260 seconds]
orivej has joined #picolisp
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
rob_w has quit [Quit: Leaving]
alexshendi has quit [Ping timeout: 240 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
pierpal has quit [Client Quit]
pierpal has joined #picolisp
groovy2shoes has quit [Ping timeout: 260 seconds]
groovy2shoes has joined #picolisp
grp has quit [Quit: box shutting down...]
groovy2shoes has quit [Ping timeout: 255 seconds]
groovy2shoes has joined #picolisp
andyjpb has joined #picolisp