IRC channel logs

2020-08-04.log

back to list of logs

<dsmith>tinga: You are too deep in the tree
<tinga>Where should I be?
<dsmith>cd cag; cd ..; GUILE_LOAD_PATH=$(pwd) ......
<tinga>aha
<tinga>Thanks, checking.
<dsmith>So for a module (foo bar) there must be a file "foo/bar.scm" visible from a dir in the load path.
<dsmith>Is if the path contians "/glork" then the files would be "/glork/foo/bar.scm"
***catonano_ is now known as catonano
<daviid>str1ngs: can you try the following 'decide-policy signal callback - https://paste.debian.net/1158910/ - and let me know, but here this works
<str1ngs>daviid: that works! why didn't I think to use change-class :(
<daviid>ok great
<str1ngs>that's an eloquent solution to this problem.
<daviid>w can only do that because the C pointer already been 'hiddenly' casted
<str1ngs>slightly off topic. I was trying to reason how best to handle exceptions in most signal. I though one catch should be enough what do you think.
<str1ngs>so change-class is pretty safe to use then?
<daviid>it is very safe in that callbac yes
<daviid>and any where the cast already happened 'in the back'
<str1ngs>okay great, this is a nice solution and should work for the other decide policies .
<daviid>yes, but again, only if the GObject instanc has been cast
<str1ngs>great, thanks for looking at this for me. I can delete some more C code now :)
<daviid>wrt exceptions, not sure - in the very few apps i wrote using guile-gnome and clutter, i never did that - if there is no bug in your callback code, what could possibly raise an exception
<str1ngs>you'd be surprised :)
<str1ngs>the main thing is I'd like to avoid a signal crashing the whole program.
<daviid>but what could cause this?
<str1ngs>in load-commit I have some logic that updates the mode-line. I've already found one bug with crylic text and uri conversion
<str1ngs>since some bugs you can not foresee, my impression with signals is it might be a good practice to guard them. keep in mind in nomad will have hooks like emacs, so users can extend things. so saving the program from termination is important
<daviid>i would only vry slectively do that - catch is expensive as well
<daviid>by the way, you should not block the compilation of your app code
<str1ngs>understandable. it's something I've just been mulling over. I've tried avoiding catch as much as possible.
<str1ngs>you mean block in a signal?
<daviid>no, passing --no-auto-compile
<str1ngs>I only use --no-auto-compile on some examples. and that's just to make sure nothing is compile cached. when I work on the Guix GI bug.
<daviid>you should only do that if the script installs in $prefix/bin and does absolutely nothing but call a proc from compiles modules ...
<str1ngs>thanks, I have a personal reason to use it in my examples. since I sometimes use it to debug GI on GUix
<daviid>ok
<str1ngs>the --no-auto-compile on $prefix/bin scripts is good advice thank you.
<daviid>wc!
<str1ngs>daviid: here's Nomad's more complete 'decide-policy signal. http://paste.debian.net/1158934 . note webkit-policy-decision-download does not actually download. it causes 'download-started to emit on the WebView's context.
<str1ngs>daviid: correction get-request should be webkit-navigation-action-get-request since its a procedure not a method.
<str1ngs>I assume that's correct because it takes a pointer as a argument not a <class>
<daviid>ys proc do not have short names
<str1ngs>understandable. I assumed it was a method for some reason.
***apteryx_ is now known as apteryx
<RhodiumToad>hmm. tricky macro question:
<RhodiumToad>I want (foo (a b) (c) (d e)) to expand to (bar (a d) (b c e))
<RhodiumToad>i.e. each element has one or two items, and I want a list of the first item of the two-item elements and a list of the last item of each
<peanutbutterandc>Hey there
<peanutbutterandc>Is it possible to (add-trace-at-procedure-call! ...) (from (system vm trap-state)) to a procedure that is defined inside another procedure (closure)?
<lampilelo>is there a standalone library for unit testing guile?
***wxie1 is now known as wxie
<mwette>sneek: later tell RhodiumToad https://paste.debian.net/1158996/
<sneek>Got it.
<chrislck>mwette thanks for your (cond-expand (guile-3) (guile-2 <code>)) trick - it worked well.
<mwette>yw
<dsmith-work>Tuesday Greetings, Guilers
<mwette>good day to you
<str1ngs>lampilelo: not exactly standalone there but there is (unit-test) that comes with guile-library
<str1ngs>or guile-lib depending on what distro you use.
<lampilelo>str1ngs: i've already set it up with the test suite from guile's source tree. is there a reason to use guile-lib? it seems kinda dead
<chrislck>lampilelo: srfi-64 is the defacto standard...
<str1ngs>lampilelo: I wouldn't consider it dead. (unit-test) is more unit tested based. one benefit of (unit-test) is the tests don't run simply by loading the file. so it really depends on your use case.
<lampilelo>chrislck: ah, i knew there was something else yet! i was surprised i couldn't find it in the manual but it's there, the reference is just a one-liner
<RhodiumToad>mwette: thanks, but I don't think that works for me - I need it to expand to literally (a b) not to an expression that results in (a b)
<sneek>RhodiumToad, you have 1 message!
<sneek>RhodiumToad, mwette says: https://paste.debian.net/1158996/
<a_v_p>Hello Guilers! Is it possible to do bi-directional communication between a process started with 'open-input-output-pipe' and the main process?
<a_v_p>I mean, I try to write a set of lines to 'sort' command and then read the sorted lines, but reading from the port blocks as soon as I try to read anything.
<dsmith-work>Yeah, that's gonna be tough.
<dsmith-work>Sort needs to read all it's input, right?
<justin_smith>a_v_p: the classic gotcha is trying to read from the process before flushing data the process is trying to read
<justin_smith>and yeah, it might be that it won't provide any output until its input is closed (for a sorting program that's a requirement!)
<dsmith-work>So sort wants to see EOF on it's input before it sends anything.
<justin_smith>grep will give you partial results as long as input flushes, sort can't possibly do so, because its problem domain makes it impossible
<dsmith-work>Consider that the last line you send might need to be the first out.
<dsmith-work>Seems like there have been more pipe questions in the last month than in the previos 10 years.
***terpri__ is now known as terpri
<a_v_p>justin_smith: Thanks, I tried to send an EOF object but problem is that the port immediately closes on EOF.
<a_v_p>Or it doesn't.
<a_v_p>Well, I figured out how to accomplish what I want with named pipes a.k.a FIFOs.