How to have an optional dependency?

2024-06-24 Thread Tomas Volf
convince the Guile that those specific variables will be bound? How do people commonly approach this? Thanks, Tomas Volf -- There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. signature.asc Description: PGP signature

Re: Weird import behaviour of digital modules

2024-06-08 Thread Tomas Volf
use-modules. Have a nice day, Tomas Volf -- There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. signature.asc Description: PGP signature

Re: warning: possibly unused local top-level variable `%foo?-procedure'

2024-06-06 Thread Tomas Volf
no-computer time :) > > -- > Linus Björnstam > > On Wed, 5 Jun 2024, at 17:02, Tomas Volf wrote: > > Hello, > > > > I am getting following warning from a guild compile: > > > > warning: possibly unused local top-level variable `%foo?-procedure' >

warning: possibly unused local top-level variable `%foo?-procedure'

2024-06-05 Thread Tomas Volf
? Are there other options? How are you approaching it? Thank you and have a nice day, Tomas Volf PS: I am not even sure why this warning happens, the `foo?' syntax transformer is exported and *does* reference it (as far as I can tell from ,expand). -- There are only two hard things in Computer

Re: How to gradually write a procedure using Guile?

2024-05-16 Thread Tomas Volf
op-level pollution, but with bit of care it seems to be manageable. Sometimes, when I mess up, it requires restarting the REPL, but I can skip the expensive parts of the setup, so it is pretty fast. Thank you both again and have a nice day, Tomas Volf 0: The full procedure is an install s

How to gradually write a procedure using Guile?

2024-05-02 Thread Tomas Volf
of "write a function, run it whole against a test". Since this is Scheme, and I *can* evaluate single expressions in the procedure body, I would like to use that to my advantage. Somehow. I realize this is a very open-ended question/email. Have a nice day, Tomas Volf -- There are

Re: Some issues with guile

2024-04-26 Thread Tomas Volf
On 2024-04-26 03:05:51 -0400, Nikolaos Chatzikonstantinou wrote: > Hello list, > > I want to talk about some issues I've encountered with Guile. I'll > quickly summarize the points and I'll expand below. > > 1. Can't connect geiser from emacs to a remote REPL server unless > versions match. > 2.

Re: Writing to closed network port causes guile to exit with error 141, not error message

2024-03-22 Thread Tomas Volf
check module/web/server/http.scm in the guile's repository, you will notice there is this line: (sigaction SIGPIPE SIG_IGN) Which caused the signal to be ignored instead of using the default handler (which is to die). Have a nice day, Tomas Volf -- There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. signature.asc Description: PGP signature

Re: Quiet compilation for scripting

2024-03-15 Thread Tomas Volf
uto-compilation-quiet or something would work. I would actually want that as well, but never got to writing the patch. Have a nice day, Tomas Volf -- There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. signature.asc Description: PGP signature

Re: using a module : rename a single definition

2024-03-03 Thread Tomas Volf
popen) ((ice-9 popen) #:select ((open-pipe . foo-bar After that you have both `open-pipe' and `foo-bar' available, pointing to the same procedure. At this point you could just re-define `open-pipe' to something else and use the `foo-bar'. Maybe there is a better way, but I

Re: How to abort a read from a socket after some time?

2024-01-22 Thread Tomas Volf
bigger) file descriptors than select. > > So I suggest using poll, not select. I did not realize there is (ice-9 poll), seems to be undocumented. I can live with being linux-only, so poll should work for me. Thanks :) Have a nice day, Tomas Volf -- There are only two hard things in Compu

How to abort a read from a socket after some time?

2024-01-21 Thread Tomas Volf
)) It still does not work: read-char (non-block): Alarm! ;; Result: # ;; 51.581392s real time, 0.000371s run time. 0.00s spent in GC. I would have expected to receive EWOULDBLOCK. But let's not get distracted by the non-blocking variant. So, what would be a good way to do this?

Re: symbol is nested in #{ ...... }#

2024-01-04 Thread Tomas Volf
rd from it: scheme@(guile-user)> (eq? #:hello (symbol->keyword (string->symbol "hello"))) $1 = #t There might be a direct way, but this is what I managed to put together after digging in the manual. Have a nice day, Tomas Volf -- There are only two hard things

Re: How to globally replace core binding?

2023-11-27 Thread Tomas Volf
Hi, thanks for the answers. On 2023-11-28 01:51:46 +0100, Maxime Devos wrote: > (set! copy-file improved-copy-file) > > This replacement 100% functioning assumes no inlining, nobody capturing the > old copy-file on the top-level, nobody calling the C function directly ... In that case this is

How to globally replace core binding?

2023-11-26 Thread Tomas Volf
Hello, I would like to replace a core binding. I know that I can define a module like this: (define-module (foo)) (define-public (copy-file a b) (display "TODO: implement file copy\n")) And I can later use it scheme@(guile-user)> ,use (foo) scheme@(guile-user)>