IRC channel logs


back to list of logs

***catonano_ is now known as catonano
<daviid>str1ngs: I pushed everything to master, maybe a good time to update the g-golf guix package, when you have some time to do so of course ... tx!
<str1ngs>daviid: I'm almost ready to update emacsy and nomad will submit a patch for g-golf at the same time. should be very soon. one quality of life thing. if you can add a tag to master. something like 0.1.0-alpha that would make updating g-golf easier, using git describe.
<refcfar>I can't find any module reflection procedure to get a list of all symbols in a module's interface. Is there one such hidden somewhere?
<refcfar>Basically something like the REPL's `,binding` but in the context of a given module
<leoprikler>yes, there is
<str1ngs>refcfar: think you want 'resolve-interface and also there is 'module-uses
<refcfar>`resolve-interface` gives me a module object but I don't know how to extract bound symbols from it
<str1ngs>(module-for-each (lambda (sym var) (list sym var) (resolve-interface module))
<str1ngs>pseudo code
<str1ngs>I broke some parenthesis pasting to :(
<refcfar>Thank you both 🙂 I get a nice list with `(module-for-each (lambda (sym var) (display sym)) (resolve-interface '(the-module)))`
<refcfar>err, `(module-for-each (lambda (sym var) (begin (display sym) (newline)))ace '(other-module)))`
<refcfar>err, you get the idea
<leoprikler>newlines are cosmetic ;)
<refcfar>butchered it
<leoprikler>indeed, now you just need to know, what you want to do to those variables
<refcfar>Yeah, I could do something like `(map (lambda (sym) (help sym)) the-symbols)`
<leoprikler>What exactly is your use case here? Yet another doc-snarf for libraries?
<leoprikler>or quick introspection in the repl?
<refcfar>It's just for debugging. I'm trying to learn about creating readers, so I'm following the documentation of `guile-reader` which mentions a bunch of token readers supposedly available in `(system reader library)` but apparently do not. First step I figured is to see all of them in there so I know whether it's an API change or if the module is entirely wrong and has none of them.
<refcfar>Specifically the token readers listed here:
<refcfar>So I have the package available and the module loaded. I run `(define sys-read-lib-syms (module-for-each (lambda (sym var) (begin (display sym) (newline))) (resolve-interface '(system reader library))))` and there are no tokens at all in there. So now I know I'm looking at the wrong module :)
*refcfar sent a long message: < >
<leoprikler>According to the docs, those should be defined in (system reader), no?
<refcfar> * So I have the package available and the module loaded. I run `(module-for-each (lambda (sym var) (begin (display sym) (newline))) (resolve-interface '(system reader library)))` and there are no tokens at all in there. So now I know I'm looking at the wrong module :)
<refcfar>(fixed the pasted code - copied the wrong thing)
<refcfar><leoprikler "According to the docs, those sho"> All that's in there is:
<refcfar>Of course I don't think I'm taking into account the re-exports?
<leoprikler>ah, no make-alternate-guile-reader is indeed exported from library only
<leoprikler>could it be that they flubbed their re-exports?
<refcfar>Is there a way to get a list of all available modules available to import?
<refcfar>(I know I can go scour through the package source for all its modules, I just like an easy, clean and reusable procedure to do these things for me)
<leoprikler>not really, but you might get close to it
<refcfar>It would also be useful in general to get an overview of what you've got available
<lloda>iiuc that would require trawling through the load-path and if the modules are deep inside you need to search the whole tree
<lloda>so i don't think it's feasible really, unless i understand you wrong
<refcfar>Yeah I was just thinking
<refcfar>Is there a "list files in directory" procedure?
<refcfar>like `ls`
<refcfar>then I could `(map ls %load-path)` and go from there
<leoprikler>((@ (ice-9 pretty-print) pretty-print) (append-map (compose (lambda (x) (if x (remove-stat x) '())) file-system-tree) %load-path))
<leoprikler>for remove-stat see `info "(guile)File Tree Walk"`
<leoprikler>alternatively, you can use guix' (find-files d ".*\\.(scm|sls)")
<chrislck>Friday greetings, guilers!
*janneke writes SIGINT handler for mingw that "somewhat works" wine
<janneke>*in wine
<dsmith-work>Happy Friday, Guilers!!
<emys>hey, I am trying to compile guile from git (on debian testing) and I get weird gc header issue.
<emys>I kind of feel like I have the wrong garbage collector installed
<emys>hmm, was able to set a build environment with guix
<civodul>emys: "guix environment guile" should give you a valid environment, with the right version of libgc
<civodul>but here the conflicting header is in /usr/include, so not Guix
<emys>the pastebin was from completely without guix
<emys>civodul, thats sth I still don't quite understand because the environment I get from `guix environment guile` doesn't let me build guile, next time I make notes what was missing. I think I did `guix environment guix` `guix engironment guile` and then it worked.
<emys>(maybe flex was missing, don't recall)
<civodul>emys: ah true, that's because to build Guile from a checkout, you need more stuff than when you build it from tarball
<civodul>including flex, texinfo, etc.
<civodul>you can add those with: guix environment guile --ad-hoc flex texinfo ...
<emys>I think it might be worth adding that to the guile manual
<emys>question: when I submit a patch to guile, would that need signed paperwork?
<daviid>emys: fwiw, you don't need guix to buld guile on debian :), and guile-3.0 is in testing already, but if/when you want build from the source, what you can do is running 'apt-get build-dep guile-3.0' - this should install everything you need to build the upstream guile-3.0 from the tarball or a git clone
<emys>daviid, cool, didnt know about `apt-get build-dep'
<dsmith-work>Yep. build-dep
<dsmith-work>emys: The HACKING file does mention what is needed to build from a git checkout
<dsmith-work>emys: Looks like the README does also
<civodul>emys: yes, you'll need to assign copyright for "legally significant" contributions (~15 lines or mroe)
<elliotpotts>hi folks, I can't seem to find any documentation on how to handle errors occurring on the C api, e.g. how do I detect if `scm_from_locale_string` (etc. etc.) failed? If anybody could give me a link, that'd be grand
<sneek>Welcome back elliotpotts, you have 2 messages!
<sneek>elliotpotts, lloda says: check
<sneek>elliotpotts, lloda says: easiest solution is to compile your code with -DSCM_DEBUG_TYPING_STRICTNESS 2