IRC channel logs
2023-03-30.log
back to list of logs
<_graywolf>I would like to use guile to configure my program, but I am unsure how that is usually done. Should I just return an alist '((name . "foo"))? Provide specific functions (set-name "foo")? Something else? <_graywolf>What is usual way this is done? Ideally with links to programs that implement some of these strategies so that I can learn from them :) <Arsen>that very much depends on what your program does <Arsen>it might be logical for you to implement a part of your program in scheme, and then provide native code to extend that, a la emacs, or you might want to just provide a few functions and a way to invoke guile from your program, a la GNU make, or you might want to provide variables and tunables and hooks that are configurable via scheme instead of configuration files, ... <_graywolf>Well the whole program is in guile, and I want to use it for config as well since the program will require user to set various hooks and callbacks to operate. <_graywolf>However I'm unsure if it's better to set the hook emacs' style (set! ...) or return some "configuration object". <cow_2001>you know what would be nice? in the guile prompt, if you write a procedure outside of parentheses, it'll show ,describe by default <lloda>you can use ,d instead of ,describe <old>cow_2001: that would not be so nice. procedure are value and the REPL print thtat value <pinoaffe>old: I mean, you can pretty much make the REPL print values in whatever way you like <pinoaffe>as long as the meaning of what is printed is clear to all users of the REPL, it shouldn't matter too much <old>As lons as the default is a good one <pinoaffe>yeah, I sure wouldn't want that in my REPL :) <old>I don't mind if someone put a define-method <procedure> in their .guile! <cow_2001>how do you run those repl commands from guile? <old>object-documentation <cow_2001>info guile object-documentation doesn't show up <old>(ice-9 documentation) <old>put this in your ~/.guile <old>and start a new REPL <old>try it with just '+' to see it <cow_2001>now it's (write obj) (newline) (write (object-documentation obj)) (newline) <cow_2001>maybe i should put the (write (object-doc...)) inside an (when (procedure? obj) ...) <cow_2001>ah, it'll blow up if there is no documentation <cow_2001>now we can start a betting pool for when i find it annoying <old>you could wrap it inside a when procedure? sure <old>but documentation is generic to any type. It's actually an object-property <old>so any predicate is valid as long as their a documentation property attched to the object <old>I already find it anoying. I don't need the documentation of '+' or '-' ^^ <old>this is why I find that the good default is to not show the doc, then you explicitely ask for it with ,describe <old>but your dot-guile is your dot-guile! <cow_2001>do you end up deleting all buffers every now and then in emacs just so you can open just the stuff you need? <cow_2001>okay, something I don't get: (define foo '()) (define (change! some-list) (set! some-list (cons 1 some-list))) (change! some-list) foo is still '(). is there a way of changing the value of foo without referring to it directly? <gnucode>hey guile people! I made a guile script last night to automount my usb stick on OpenBSD via hotplugd. That was fun! <lloda>scheme variables are names, not places <lloda>you can use boxes or something like that if you need the feature <gnucode>hey guile people! I am trying to install haunt on OpenBSD. I need to install guile-commonmark first. <gnucode>so I have guile3.0 installed in OpenBSD. the binary is guile3.0 , which is a weird name. <gnucode>the guile commonmark is failing because it is trying to find the guile binary. <gnucode>is there a way to tell the configure script that the guile binary is called guile3.0? <Arsen>which configure script? commonmark? <gnucode>Yes. Guile commonmark's configure script cannot find the guile binary, because the binary is called guile3.0 <Arsen>try specifying GUILE=guile3.0 <gnucode>No Guile development packages were found. <Arsen>do you have pkg-config or pkgconf? mind posting the config.log? <Arsen>the latter should reveal exactly what it tried and why it failed <Arsen>seems that the version you have doesn't even try 3.0 <Arsen>try a fresh master off of the uptsream repo <Arsen>the latest release doesn't list 3.0, but the development branch does <gnucode>Provide an AUTOCONF_VERSION environment variable, please <Arsen>you'll need automake and autoconf <Arsen>aclocal should be part of automake <gnucode>ahh. I didn't install automake yet... <Arsen>well, you could try running aclocal manually <gnucode>"/usr/local/bin/aclocal[34]: /usr/local/bin/aclocal-1.16.5: not found" <Arsen>what did your automake 'make install' install? <gnucode>but `which aclocal` -> /usr/local/bin/aclocal <gnucode>ls /usr/local/bin/aclocal -> /usr/local/bin/aclocal* <Arsen>are there any other files starting with aclocal in there, that's what I'm wondering <Arsen>alternatively, I can build you a dist tarball, if you want <gnucode>if you don't mind. that would be awesome! <gnucode>are there any other files starting with aclocal in there, that's what I'm wondering -> how would I check that? <gnucode>Arsen: in /usr/local/bin I have "aclocal" and I have "aclocal-1.16" <Arsen>well, just `ls /usr/local/bin/aclocal*' <Arsen>try calling aclocal-1.16 directly <gnucode>aclocal-1.16 seems to have ran without issue. <Arsen>neat, try autoreconf -i now (without the -f) <gnucode>that failed. but I also have 3 autoreconf binaries in /usr/local/bin. <gnucode>so let me try the latest one "autoreconf-2.71 -i" <Arsen>that's in autoconf, so that's 2.71 <gnucode>"/usr/local/bin/aclocal[34]: /usr/local/bin/aclocal-1.16.5: not found" <Arsen>try ACLOCAL=aclocal-1.16 ./bootstrap <gnucode>that worked right up until "/usr/local/bin/automake[34]: /usr/local/bin/automake-1.16.5: not found" <gnucode>I have 2 automakes installed as well. :) <Arsen>try AUTOMAKE=automake-1.16 ACLOCAL=aclocal-1.16 ./bootstrap <Arsen>(you see where this is going...) <gnucode>hey hey I have a configure script now! <Arsen>I got some test fails on my end fwiw <Arsen>run make check - it might fail there too <gnucode>(use-modules (commonmark sxml)) that worked. <gnucode>well I suppose that I should report this as a bug to the main developer. <gnucode>apparently even guix is getting test failures. <gnucode>Arsen: thanks for the help. I'm off to install haunt now. <gnucode>Arsen: sweet. haunt is installed. now I get to build a new blog post. <gnucode>dthompson: hey I just installed haunt on openBSD! and it works! <dthompson>sneek: later tell gnucode wow, neat! glad haunt works on openbsd. thanks for the report!