IRC channel logs

2020-05-02.log

back to list of logs

***jao is now known as Guest23450
<mbakke>iv-so: does %libgit2 in "$prefix/share/guile/site/3.0/git/config.scm" look correct?
***siel_ is now known as siel
<iv-so>mbakke: i am not sure, %libgit2 is /usr/lib/libgit2
<iv-so>i think i understand now
***wleslie_ is now known as wleslie
***guix-vits is now known as dontbanmeplease
***dontbanmeplease is now known as guix-vits
<tohoyn>is it guaranteed that procedure abort-to-prompt never returns in guile 3.0?
***apteryx is now known as Guest78054
***apteryx_ is now known as apteryx
<RhodiumToad>not at all
<RhodiumToad>abort-to-prompt passes its continuation to the handler, so it can return as many times as that continuation is later called
<RhodiumToad>e.g.:
<RhodiumToad>(define (foo) (abort-to-prompt 'x) (display "resumed after prompt"))
<RhodiumToad>(call-with-prompt 'x (lambda () (foo)) (lambda (cont) (cont) (cont) (cont)))
<RhodiumToad>which displays "resumed after prompt" 3 times
<tohoyn>ok. tx.
<RhodiumToad>as an optimization, there's apparently a check for whether the handler is a lambda expression that doesn't reference the continuation arg; since in that case the abort is guaranteed _not_ to return, the continuation doesn't need to be preserved
<tohoyn>ok. I've got that situation.
<rgherdt>Hi all. I'm getting an error when including any file by relative paths: "attempt to include relative file name but could not determine base dir"
<rgherdt>this is on Guile 3.0.2, manually compiled on Debian Stable
<rgherdt>any idea?
<rgherdt>by the way, the command is: (include "test.scm")
<RhodiumToad>(include) is relative to the location of the file that called it. if you're calling it from the repl, there's no file for it to be relative to
<RhodiumToad>i.e. if /foo/bar.scm contains (include "baz/quux.scm") then that includes /foo/baz/quux.scm regardless of the process current dir at the time
<RhodiumToad>maybe you're looking for (load)
<rgherdt>RhodiumToad: many thanks. I'm getting the problem while evaluating it in emacs. I defined a library in a .sld file which includes an implementation file (using R7RS syntax) and tryied to evaluate it. That was the problem, loading the .sld solved it. Thanks a lot.
<tohoyn>is it possible to define a variable in a guile module so that if the value of the variable is set in another module the binding of the variable in the original module will change too?
<tohoyn>if I define (define-module (test1) #:export (myproc1 myproc2)) and myproc2 uses myproc1 I would like to have the binding of myproc1 in myproc2 if the value of myproc1 is set in another module.
<tohoyn>binding of myproc1 in myproc2 to change if the value of myproc1 is set in another module
<RhodiumToad>are you using guile3?
<tohoyn>yes
<RhodiumToad>I think you need to declare the module to be non-declarative to do that
<tohoyn>I'll try
<RhodiumToad>basically, read the stuff in the 3.0 docs about declarative modules
<tohoyn>ok. tx.
<tohoyn>It seems that I have two source code files A.scm and B.scm so that A defines a global variable VAR and B changes that the binding of VAR in A is unchanged. can this be changed?
<RhodiumToad>did you even read what I just wrote?
<tohoyn>yes but A and B are not modules
<tohoyn>just source code files
<RhodiumToad>how are you loading them?
<tohoyn>loaded with "load" or "load-compiled"
<RhodiumToad>can't reproduce that
<RhodiumToad>if I have a.scm with (define A 123) (define (get-A) A) and b.scm with (define A 456) then after loading b.scm, (get-A) does indeed return 456
<tohoyn>ok. I probably have some bug in my code.
<mwette>o/
<civodul>hey mwette
<cyclopsian>Hi everyone, I have a Guile extension written partly in C and partly in Scheme and I have been writing docstrings. Are there any doxygen-like tools to extract those docstrings into a nice texinfo manual for an API reference like in the guile documentation, or do I have to copy them manually into a separate texi file?
<cyclopsian>Worst case, if nothing else exists, I plan to write a small script to iterate the module and extract the docstrings.
<Aurora_iz_kosmos>I'm not aware of any. Oddly-enough.
<dsmith>cyclopsian: The C doc snarfer that's in the guile sources is not installed.
<mwette>cyclopsian: Are you tlking about the c or scm files?
<mwette>In my scm files I write comments before each function in texinfo. Then I use an emacs sub-mode I wrote to convert to text to include in Guile docstring. See https://paste.debian.net/1144359/ and https://github.com/mwette/guile-contrib/blob/master/scheme-texidoc.el
<mwette>I have a script that scans through scm files and extracts the sequence of comment-lines that start with `;; @'. However, I have not been using this extensively.
<mwette>The emacs sub-mode extracts the texinfo source and runs through "texi2any --plaintext" and stuffs that into the procedure code.
<mwette>The emacs code is not super-robust (yet).
<cyclopsian>That's really close and I probably should have done that. I did it in the reverse and all my procedures have the docstrings in the code already, but no comments
<Aurora_iz_kosmos>First field as command is sorta de-facto standard way to make docs in Guile.
<Aurora_iz_kosmos>s/command/string-comment/
<cyclopsian>I have them like SCM_DEFINE(..., "docs here") { } and (define (f x) "docs here" x)
<cyclopsian>And "docs here" is filled in already
<Aurora_iz_kosmos>Yeah, (define (f x) "much comment very info" x) is the standard way.
<mwette>Yes. And at the Guile prompt if you type `,d f' you see "much comment very info" displayed. My (incomplete) emacs approach makes that comment nicely formatted.
<mwette>here is a more elaborate example: https://paste.debian.net/1144364/
<Aurora_iz_kosmos>Unfortunately I know too little about parsers to really comment on that.
<dsmith>cyclopsian: With the C SCM_DEFINE macros, you run a separete preprocessor pass that expands those macros into files with funky indicators. Then there are a few C progs (in lex?) that munge those into the .text help files that guile uses.
<dsmith>cyclopsian: See the guile-cairo project.
<cyclopsian>Thanks. I did some grepping and module/scripts/doc-snarf.scm seems to do parts of it
<dsmith>cyclopsian: http://git.savannah.nongnu.org/cgit/guile-cairo.git/tree/guile-cairo/Makefile.am#n46
<lfam>I'm curious, what is the 'in-vicinity' procedure. Or more generally, what is the concept of "vicinity" in Scheme?
<lfam>Should I just read SRFI-59?