IRC channel logs

2022-08-05.log

back to list of logs

<lilyp>apteryx: rnrs enums are weird
<lilyp>imho they resemble flags more than enums
<rgherdt>hi all! Question: I defined GUILE_LOAD_PATH=...:/tmp/exps (same for GUILE_COMPILED_LOAD_PATH), and created a file "/tmp/exps/my-lib/foo.sld" containing the module definition of (my-lib foo). Now, when running guile with the --r7rs and calling '(import (my-lib foo))', the module is imported correctly. But use-modules fails, I have to call '(primitive-load-path "my-lib/foo.sld")' first. But say I have a different module that depends
<rgherdt>on (my-lib foo), and want to compile it with guild. What can I do to make it find '(my-lib foo)'?
<rgherdt>assuming I'm using use-modules, and not import
<rgherdt>hmm, use-modules also works when guile is called with --r7rs
<flatwhatson>setting GUILE_LOAD_PATH or passing -L /tmp/exps as an argument should work
<flatwhatson>i've used that approach with regular guile and r7rs mode without issues
<rgherdt>flatwhatson: thx, but somehow it doesn't work, I get a "no code for module (my-lib foo)" error. Only with --r7rs it works. I tried with Guile 3.0.5 and 3.0.8
<rgherdt>on a related note, where does Guile look for 'included files, say if I do a '(include "impl.scm") in my library definition? Only on the relative path, or is there some env var that sets other directories?
<flatwhatson>rgherdt: with --r7rs it will load r7rs modules, otherwise you'll probably need to use (define-module (my-lib foo) ...)
<flatwhatson>sounds like you expect r7rs modules to be loaded with use-modules from a non-r7rs-mode guile?
<rgherdt>no, I'm defining a guile module:
<rgherdt>;; foo.sld
<rgherdt>(define-module (my-lib foo) #:export (foo)) (define (foo x) (format #t "Hello ~a" x))
<rgherdt>that's inside /tmp/exps/my-lib/
<rgherdt>hmm, I think I got it. Renaming "foo.sld" to "foo.scm" solved the problem
<rgherdt>as does passing '-x ".sld"' to guile
<rgherdt>regarding my question about paths where 'include' searches for files, any ideas?
***civodul` is now known as civodul
<apteryx>jackhill: would you perchance use the nouveau driver on some machine? I'm seeing video artifacts in jami with qt 6 from guix when using this driver, was wondering if it's reproducible for someone else.
<cwebber>o/
<drakonis>ahoy
<jackhill>apteryx: no, sorry, I don't have the relivant hardware
<apteryx>OK, no worries, thanks
<apteryx>(oops, wrong channel too, apologies)
<dsmith-work>!uptime
<dsmith-work>Happy Friday, Guilers!!
<dsmith-work>Except for sneek
<dsmith-work>sneek: botsnack
<dsmith-work>sneek: botsnack
<sneek>:)
<dsmith-work>Ahh. Gootbot
<dsmith-work>!uptime
<sneek>I've been running for one month and 20 days
<sneek>This system has been up 7 weeks, 1 day, 15 hours, 54 minutes
<apteryx>there's 'eval-when' in Guile; is there 'eval-after' ?
<apteryx>I use syntax that defines a binding at the top level... I later want to wrap (shadow) such binding, reusing the same variable name. Is it posssible?
<apteryx>so my question is this: how to redefine syntax at the top level?
<apteryx>are they evaluated in order, and I can just e.g. define-syntax-rule below the original definition to redefine it?
<apteryx>not sure how to avoid syntax-rules recursing the syntax I'm trying to redefine
<apteryx>seems like quote-syntax may help
<apteryx>seems like it's not possible, per http://community.schemewiki.org/?scheme-faq-language: "Note that it is not possible for top-level redefinitions to access to original definitions"
<dsmith-work>apteryx: There may be some sleight-of-hand than can be done with modules and renaming.
<dsmith-work>Not sure.
<spk121>There is a module obarray that holds the top-level definitions, and you can modify that obarray if you so choose to change top-level definitions
<spk121>But, if things are compiled, I'm not sure what happens
<apteryx>uh. why do (class-name (class-of lightdm-gtk-greeter-configuration?)) -> <procedure>, but (class-name (class-of (module-ref (current-module) 'lightdm-gtk-greeter-configuration?))) -> <macro> ? The later causes 'find' to fail (it wants a proc, not a macro).
<apteryx>because it does '(check-arg procedure? pred find)'
<apteryx>can I do something to turn that syntax-transformer into a proper procedure?
<apteryx>even weirder: (procedure? (module-ref (current-module) 'lightdm-gtk-greeter-configuration?)) -> #f
<apteryx>seems like a bug to me? https://paste.debian.net/1249488/
<apteryx>perhaps I need to delay the code introspecting macro-generated bindings