<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
<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 :)