IRC channel logs

2020-07-04.log

back to list of logs

***jonsger1 is now known as jonsger
***jonsger1 is now known as jonsger
<chrislck>is (apply fn args) known to have performance issues with big args?
<chrislck>hmmm no: (define lst (iota 10000000)); ,time (apply + lst) = 0.3s and (fold + 0 lst) = 0.5s
<montxero>I've written a small library, how do I load it in the repl?
<RhodiumToad>what kind of library?
<montxero>one 1 wrote my self
<RhodiumToad>,use (whatever) is a shorthand for (use-modules (whatever)) for the repl
<montxero>ahhh
<montxero>thanks
<RhodiumToad>you may also need to add the current dir or whatever dir your module is relative to to the load-path, there's a function for that
<montxero>was killing my self with ,import (whatever)
<montxero>I did (add-to-load-path "pwd")
<RhodiumToad>(add-to-load-path ".") is more likely what you wanted unless your dir is named "pwd"
<RhodiumToad>,import is the same as ,use afaik
<montxero>import didn't work for me
<montxero>Hmmm, do I need to do someting special to call funtions defined in the library?
<RhodiumToad>how did you define the library?
<montxero>r6rs style definition.
<RhodiumToad>ah
<montxero>Making a pastebin now
<RhodiumToad>ok, so the docs say the r6rs definition is actually expanded to a guile-style (define-module), so it should be fine to load it with ,use
<RhodiumToad>when you say "didn't work", what actually happened?
<montxero>RhodiumToad: https://pastebin.com/SVDyb5Be
<RhodiumToad>the (add-to-load-path) part needs to be done in the repl, not the module
<montxero>RhodiumToad: I can't call functions exported in the library
<montxero>I did the (add-to-load-path) in the repl as well
<RhodiumToad>did the ,use or ,import succeed or fail?
<montxero>It is in the library so it compiles
<montxero>both ,use and (import (lib)) worked
<montxero>,import worked as well
<RhodiumToad>does the file name not match the module name?
<montxero>it does. the file name is interpreter.scm
<RhodiumToad>hm, it works when I try a trivial module using the same style
<RhodiumToad>I put (library (interpreter) (export foo) (import (rnrs)) (define (foo x) (+ 1 x))) into interpreter.scm,
<RhodiumToad>and did (add-to-load-path ".") and ,use (interpreter) in the repl
<RhodiumToad>and then (foo 1) returned 2 as expected
<montxero>will try that now
<RhodiumToad>what guile version are you using?
<montxero>3.0.2
<RhodiumToad>ok, I just tested that with the exact same as above and it also worked
<montxero>I am typing that in to try it now
<montxero>It did for me as well!
<montxero>but my original library is not working yet
<montxero>Does it matter that I compiled it first?
<montxero>with guile interpreter
<montxero>with `guile interpreter.scm ` in a terminal?
<RhodiumToad>shouldn't matter, no
<dale`>I have had patches in the database #40719 for some time now to introduce an improved (ice-9 getopt-long) module. I realize it's a bit of an elephant-bomb compared to most patches, but was wondering if someone might be able to review it sometime soon?
***terpri__ is now known as terpri
<jackhill>I have a geiser problem: when using M-x geiser-connect, it takes a long time to connect, and the prompt in the repl looks like: contains many ^A^B
<jackhill>everything seems to work fine with M-x run-geiser. I suspect I've done something wrong with my enviornment, but where should I start looking?