ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Check also http://www.picolisp.com for more information
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #picolisp
<DKordic> Good morning.
<DKordic> seteeri: No, "task" is Cooperative Multitasking based on Linux Syscall "poll".
<DKordic> Android is the new xterm.
<DKordic> Regenaxer: Sorry for the delay. I could not terminate the app. When I tapped square button it was minimized unlike any other app. Tapping it's own ""x"" button it only got fullscreen.
_whitelogger has joined #picolisp
<Regenaxer> Moin DKordic!
<Regenaxer> also, we talked about task in PilCon
<Regenaxer> Android apps are never really terminated
<Regenaxer> you can wipe them out of the task list, and it is up to them what they do
<Regenaxer> PilBox really terminates. It stops the picolisp binary
<Regenaxer> but other apps seem to survive until Mr. Google kills them
<Regenaxer> So to "stop" Jitsi, just press the red phone and the session is over
<Regenaxer> If no longer needed, swipe it off the screen
_whitelogger has joined #picolisp
<aw-> Regenaxer: hi, i'm wondering if there's an issue with (alarm) or (abort) in pil21
<aw-> i have a program which I set a timer for 600 seconds, and it works fine.. but i have another i set for 3600 seconds and it **never** gets called
<aw-> i do (abort 3600 (my-prog)) and it never aborts
<aw-> but (abort 600 (my-prog)) works fine
<aw-> no problem with pil64
<Regenaxer> Do you have the latest version?
<aw-> hmmm.. latest.. not sure
<Regenaxer> I think this environment changed last week
<aw-> oh
<aw-> latest Nov 27, oops
<Regenaxer> I did a major rewrite of the I/O system
<Regenaxer> not sure if this is the reason, but the newest version is better :)
<aw-> oh ok
<aw-> yes i'm updating now and will report back
<Regenaxer> Thanks!
<aw-> ok updated, running it now with (abort 3600)
<aw-> i'll let you know later if it's fixed
<Regenaxer> BTW, the Debian maintainer is now packaging. He has no problem with the license
<Regenaxer> (puts pil to GPL on Debian)
<aw-> oh, great!
<aw-> i guess i'll do that for the TinyCore release as well
<Regenaxer> good
<Regenaxer> No problem for us either, right?
<aw-> what do you mean?
<Regenaxer> No restrictions as we keep pil itself on MIT/X11
<Regenaxer> Little test here:
<Regenaxer> : (abort 2 (loop (inc (0]
<Regenaxer> -> NIL
<Regenaxer> Looks all right
<aw-> i usually put a NOTICE file in my repo when it links to GPL source code
<Regenaxer> good idea
<Regenaxer> For PilBox I simply put the GPL file into the TGZ
<Regenaxer> (cause PilBox ships libreadline.so)
<aw-> (i also do it for non-GPL stuff to), ex:
<Regenaxer> Perfect
<aw-> i think NOTICE file is de-facto standard for OSS projects
<Regenaxer> I see
<aw-> in case of PilBox, since you're distributing the .so then you should probably host the exact source code package on your server
<aw-> and provide a link to it in your NOTICE file
<Regenaxer> hmm, sounds a bit tedious
<aw-> true, but that's the condition of GPL
<aw-> if you distribute GPL, you have to provide the sources
<Regenaxer> I don't even have the sources
<Regenaxer> I took the existing .so
<aw-> you should probably find the sources ;)
<aw-> technically you don't **have** to host the sources though, but you do have to show how to obtain them
<Regenaxer> In fact I have two distros, the APK at Google Play and a separate TGZ
<aw-> or promise to make them available on demand
<Regenaxer> Nobody does for APK, no?
<Regenaxer> I should remove readline from PilBox, it is never called in fact
<Regenaxer> just to keep the runtime happy
<Regenaxer> but placing a link to some GNU repo is easier perhaps
<Regenaxer> So I'll make a NOTICE file patterned along your version
<aw-> great
<Regenaxer> thanks!
<aw-> it's probably fine to link to the original sources of libreadline, if they're unmodified
<Regenaxer> So I don't need to put the GPL file?
<Regenaxer> just the pil COPYING plus a NOTICE explaining readline?
<Regenaxer> Let's see how Kanru (Debian Pil maintainer) does it ;)
<aw-> yes that's usually where I do
<aw-> because the location of the sources includes the license file
<Regenaxer> true
<aw-> it would be such a stupid thing to duplicate the license file all over the place
<Regenaxer> great, GPL is also very big
<aw-> yes exactly
<Regenaxer> wasting too many bytes ;)
<aw-> T
<Regenaxer> I did not know about the NOTICE convention
<Regenaxer> On this Debian server I find only two:
<Regenaxer> $ locate NOTICE
<Regenaxer> oops
<Regenaxer> cant past '/'
<Regenaxer> paste
<Regenaxer> anyway :)
<aw-> Apache has a good example:
<Regenaxer> ok
<aw-> it's a bit meta.. it's a file to tell you the license of all the files
<Regenaxer> T
<aw-> instead of 1) including every license file, 2) adding a copyright notice to every file.
<aw-> much easier to just maintain one NOTICE file
<Regenaxer> right
<aw-> and you can put as much or as little information as you want
<Regenaxer> I'll stay with your pattern
<aw-> OK
<Regenaxer> I'm happy if I don't have to abandon readline. It is the standard everyone is used to, and here is no full replacement
<aw-> yes that would be troublesome,although I understand why nobody wants GPL as well
<aw-> it's quite a burden when you want to do non-OSS work
<Regenaxer> looks like
<aw-> of course the only winners in all this are the lawyers ;)
<Regenaxer> as always
<Regenaxer> lawyers and tax advisors
<aw-> haha yes
<aw-> Regenaxer: confirmed timer works now!
<Regenaxer> Good news :)
_whitelogger has joined #picolisp
jibanes has quit [Ping timeout: 260 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 265 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 240 seconds]
jibanes has joined #picolisp
wineroots has quit [Remote host closed the connection]
mario-goulart has quit [Remote host closed the connection]
mario-goulart has joined #picolisp
Blukunfando has quit [Ping timeout: 268 seconds]
GrayArea has quit [Ping timeout: 240 seconds]
GrayArea has joined #picolisp
m_mans has joined #picolisp
<m_mans> Hi all!
<Regenaxer> Cheers m_mans!
GrayArea has quit [Ping timeout: 240 seconds]
<m_mans> Regenaxer: hi! A little question :) I've tried to use (err NIL (in '(curl ..., it seems doesn't redirect STDERR to STDOUT
<Regenaxer> Hmm, haven't used it a while. Let me check
<m_mans> And thanks again for PilCon, it was great pleasure!
<Regenaxer> :)
<Regenaxer> The code of 'err' looks correct
<Regenaxer> (if (nil? (needSymb Exe X))
<Regenaxer> (dup ((outFile (val $OutFile)) fd))
<m_mans> the idea was to improve my curl wrapper to catch curl error messages in case when exit code is nonzero
<Regenaxer> Ah, but this is another process
<m_mans> yes
<Regenaxer> So you need to redirect *that* stream
<Regenaxer> I use "curl" "-s" for that reason
<Regenaxer> otherwise (in (list "sh" "-c" "curl ... 2>/dev/null" ...
<m_mans> in fact I use (curl "-isS" "-m" 3 "-X" "GET" "bad url")
<Regenaxer> Looks good
<m_mans> let me look again in man curl
<Regenaxer> yes, but probably it has direct option to redirect stderr
<m_mans> btw if I use (err "file" (in '(curl ... - that works fine
<Regenaxer> Not sure
<Regenaxer> Did it work in pil64?
<m_mans> curl has --stderr option, let me try. Btw, that was in pil64
<Regenaxer> ok
<Regenaxer> I tried this:
<Regenaxer> : (err "a" (in '(ls "foo")))
<Regenaxer> -> NIL
<Regenaxer> $: (err "" (in '(ls "foo")))
<Regenaxer> ls: cannot access 'foo': No such file or directory
<Regenaxer> -> NIL
<Regenaxer> Seems correct. "a" had an error message
<m_mans> err with file worked fine for me too. Btw --stderr option saves me
<Regenaxer> My test did also ""
<Regenaxer> ie NIL
<Regenaxer> and it showed up on the terminal
<Regenaxer> or this works too:
<Regenaxer> (out "a" (err NIL (in '(ls "foo"))))
<Regenaxer> I think it is correct
<m_mans> : (err NIL (in '(ls "foo") (setq A (till NIL T))))
<m_mans> ls: cannot access 'foo': No such file or directory
<m_mans> -> NIL
<m_mans> : A
<m_mans> -> NIL
<m_mans> :
<Regenaxer> yes, correct
<m_mans> what's wrong with my example? I expected to have message in A
<Regenaxer> "If the argument is NIL, the current output stream will be used."
<m_mans> aaa
<m_mans> Got it
<Regenaxer> :)
<m_mans> How could I modify my last example to redirect *all* output of ls command to stdout?
<Regenaxer> (err NIL ) makes sense if stdout of the whole process (script) is redirected somewhere
<Regenaxer> yes, I think this is the way
<Regenaxer> (out NIL (err NIL ... ?
<m_mans> not really to stdout, but to *one* single stream
<m_mans> to be able to read it with (till.. )
<Regenaxer> (out "a" (err NILL goes all to "a"
<Regenaxer> ok, I see
<m_mans> I've solved curl case with --stderr, but now I'm just curious if it possible to do without files and sh
<Regenaxer> should be possible
<Regenaxer> Sorry, later
<m_mans> np
<Regenaxer> family ... ;)
<Regenaxer> a little later please
<Regenaxer> (err NIL (in '(ls "foo") (setq A (till NIL T)))) cannot work
<Regenaxer> it redirects tho err of the whole 'in'
<Regenaxer> perhaps 'pipe' ?
<Regenaxer> : (pipe (err NIL (in '(ls "foo"))) (line T))
<Regenaxer> -> "ls: cannot a....
<m_mans> ok, thanks! Need to learn pipe more :)
<m_mans> : (show (req-get-json "https://httpbin.org/get"))
<m_mans> exitcode 0
<m_mans> $177470231615661 (("args") ("headers" ("Accept" . "application/json") ("Host" . "httpbin.org") ("User-Agent" . "curl/7.68.0") ("X-Amzn-Trace-Id" . "Root=1-5fdf8dfa-7d396a8d1590fc1a651a5964")) ("origin" . "92.255.174.189") ("url" . "https://httpbin.org/get"))
<m_mans> headers (("access-control-allow-credentials" . "true") ("access-control-allow-origin" . "*") ("server" . "gunicorn/19.9.0") ("content-length" . "269") ("content-type" . "application/json") ("date" . "Sun, 20 Dec 2020 17:46:34 GMT"))
<m_mans> httpcode 200
<m_mans> httpver "HTTP/2"
<m_mans> cmd (curl -isS --stderr - -m 3 -X GET -H "Accept: application/json" "https://httpbin.org/get")
<m_mans> -> $177470231615661
<Regenaxer> Wow!
<Regenaxer> really impressive
<m_mans> I hope such wrapper could be more useful if one need e.g. response headers
<Regenaxer> yeah
<m_mans> it also can survive curl errors
<Regenaxer> and is well commented
<m_mans> : (show (req-get-json "https://"))
<m_mans> exitcode 768
<m_mans> cmd (curl -isS --stderr - -m 3 -X GET -H "Accept: application/json" "https://")
<m_mans> err "curl: (3) URL using bad/illegal format or missing URL^J"
<m_mans> $177470231620403 NIL
<m_mans> -> $177470231620403
<Regenaxer> That`s why you needed to catch errors
<m_mans> I'm currently too lazy to publish it on hithub, maybe just post to mailing list as example
<Regenaxer> Mailing list is good
<Regenaxer> or a short wiki article?
<m_mans> Ah, also good idea
<m_mans> I'll try
<Regenaxer> plus announced in mailing list
<m_mans> ok
<Regenaxer> great :)
<m_mans> I could improve this wrapper infinitely, end up with a monster, so I need to stop somewhere, heh
<Regenaxer> haha, yes
<m_mans> ok, see you!
<Regenaxer> Have a nice (late) evening!
<m_mans> )
<Regenaxer> good night in your case :)
m_mans has quit [Ping timeout: 256 seconds]