IRC channel logs

2024-10-01.log

back to list of logs

<daviid>sneek: later tell tohoyn (-) there is a <callback> class, see the (g-golf hl-api ccc) module; (-) callback are imported 'on-demand' (meaning as there are effectively being used, not as part of the import of the function/method that defines it as one of its arg(s); (-) but you can 'force' an import: (gi-import-callback (g-irepository-find-by-name "Gtk" "CustomMeasureFunc")) => #<<callback> 7fd47eb1d300>; (-) when imported, the callback
<daviid>instance is cached: (gi-callback-inst-cache-ref 'custom-measure-func) => #<<callback> 7fd47eb1d300>
<sneek>Will do.
<cpli>is there a guile/scheme lib for the gnu rec format?
<daviid>cpli: you mean recutils?
<cpli>yea!
<daviid>afaict, it is in guix
<daviid>gnu/packages/databases.scm
<cpli>wait, but is recutils written in scheme?
<daviid>ah, not sure
<daviid>but guix extensively uses it, so it must exists somewhere
<cpli>i'll update if i find it
<daviid>cpli: you may ask in guix, i guess they would know better
<cpli>gnu.org being down for me isn't making searching any easier though ^^
<daviid>cpli: but if you have guix installed, you may search the guix tree
<daviid>cpli: cd you guix source tree, then: find . -name '*.scm' | xargs grep -a recutils
<daviid>but i can't identify a guile-recutils package though
<cpli>ACTION nods
<cpli>by source tree you don't mean the guix store, do you? where does guix usually install its source tree to?
<daviid>i have a local clone
<cpli>oh, i should do the same
<daviid>it seems recutils itself has the guile binding, but i also can't access gnu.org at the moment (ofc) so ...
<cpli>i'll keep that in mind, thank you
<old>regarding srfi-234, I'm not sure so sure if I like the 3 returned values on both success / error. I feel that this kind of control flow is better expressed with CPS by passing a success and an error procedures
<sneek>Yey! dsmith is back!!
<SrainUser>anyone knows of a library to do FFI between Guile and Common Lisp?
<jlicht>Does guile have an analogue to Python's `if __name__ == "__main__"`?
<ArneBab>jlicht: you can use shell indirection: https://www.draketo.de/proj/py2guile/#sec-2-2-3-2-2
<ArneBab>jlicht: that makes your file executable and at the same time usable as module.
<jlicht>ArneBab: Thanks! I knew I saw this somewhere, and indeed it was in your writings :-)
<ArneBab>I think I should really update that (as "second edition: 10 years later"), but donโ€™t feel like I have the time and brain for that at the moment.
<dsmith>sneek, botsnack
<sneek>:)
<chrislck>sneek: botsnack
<sneek>:)
<cpli>jlicht: you would want to check if a top-level program is ran because it was imported by another module?
<cpli>(oh, i should've scrolled down)
<morenonatural>how can/should I short-circuit a chain of commands? kinda like Rust's `?` operator
<morenonatural>xxx-transduce with rall?
<morenonatural>*rall ๐Ÿ‘‰๐Ÿพ revery
<old>there is a weird thing with system and system*
<old>SIGINT is set to SIG_IGN in the child that executes the command
<old>which is not what system(3) does
<old>SIGINT is suppose to be ignored only in the parent, not the child
<old>During execution of the command, SIGCHLD will be blocked, and SIGINT and SIGQUIT will be ignored, in the process that calls system(). (These signals will be handled according to their defaults inside the child process that executes command.)
<old>but, these defaults are not restored. Thus SIGINT is ignored in subprocesses. This is not something I was expecting
<old>Is this a correct behavior by Guile or should it behave like libc system(3)?
<old>actually, "system" will restore SIGINT to SIG_DFL, but not "system*". Sounds to me like a bug.
<graywolf>Hi, is my research correct regarding there not being any direct access to the port table? So I need to collect the ports using port-for-each and (set! res (cons port res)) or somethings like that?
<graywolf>Does the iteration over port has some specific order? Or I cannot rely on that?
<tomnor>Does a <file> inside a (include <file>) form inside a (define-library ...) form need to be an absolute filename?
<tomnor>Given that the file having the define-library form is in %load-path
<tomnor>Or rather, with code as pasted at https://paste.debian.net/1331015
<tomnor>when I say (import grok-lib)
<tomnor>I get In procedure open-file: No such file or directory: "guile-libs/grok.scm"
<tomnor>And then: grok.scm
<tomnor>It seems I get a complaint about the grok.scm not found, and then it is evaled?
<sneek>Yey! chrislck is back
<graywolf>Just making sure but parameters are safe to use with threads right? The thread will see the value of parameter at the time of thread creation. Therefore pattern like (parameterize ((foo 'bar)) (call-with-new-thread (lambda () (pk (foo)))) is safe, well-defined and race-condition free. Correct?
<dsmith>sneek, botsnack
<sneek>:)
<dsmith>Wow! Over 200 nicks in #guile!
<haugh>graywolf calling a symbol is an error but other than that, yes, one of the principle advantages of parameters is that they're thread-safe. I was skeptical too but I've never been able to break it.