IRC channel logs

2024-01-02.log

back to list of logs

<lechner>Hi, what's the canonical way to capture stdout from system*, please?
<flatwhatson>lechner: use pipes instead (https://www.gnu.org/software/guile/manual/html_node/Pipes.html)
<vixus>hi all, could someone please point me to any documentation for the `=>` syntax? I really can't seem to find it anywhere
<flatwhatson>vixus: the "=>" syntax in what? cond?
<lechner>flatwhatson / thanks! i keep forgetting about the Guile pipes
<vixus>@flatwhatson: Spotted it here (https://guix.gnu.org/manual/en/html_node/Using-the-Configuration-System.html - Ctrl+F "System Services") and it looked like a define+evaluate shorthand of some kind
<flatwhatson>lechner: couple of examples here: https://paste.debian.net/1302747/
<flatwhatson>vixus: the meaning of => is given by the macro using it, it's not meaningful by itself
<flatwhatson>in this case it has some special meaning for the guix-service-type macro
<vixus>ah I see. that makes sense now, thank you
<flatwhatson>actually it might be modify-services which gives => its meaning here
<flatwhatson>matching elements of %base-services which are "guix-service-type" or "mingetty-service-type", taking their config as "config", modify it as specified
<vixus>flatwhatson: yes I think ultimately the `=>` syntax is defined here: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services.scm#n305
<vixus>and then used for modify-services here: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services.scm#n386
<gabber>\o #guile! how can i get both the standard output of a function and the return value? say, for (lambda _ (display 'foo) 42) i want 42 to be stored in some place and 'foo somewhere else. (with-output-to-string thunk) simply discards the return value, right?
<gabber>ah, i just (set!) from inside the thunk.
<freakingpenguin>Heyo. I'm writing a macro that can take either 1 or 2 arguments, but no more, and the solution I came up involves some code dupe and feels inelegant. Anyone mind taking a look and seeing if there's a better way? https://paste.debian.net/1302789/
<dthompson>freakingpenguin: a common strategy is to have the cases of fewer args expand to use more args
<dthompson>recursively applying the macro
<dthompson>brief forms expand to more verbose forms with desired defaults
<freakingpenguin>dthompson: Gotcha, thanks!
<dthompson>np :)
<freakingpenguin>Macros are easy right up until you start nesting defines or use ... in odd ways, then my head explodes.
<sneek>tohoyn: Greetings
<tohoyn>sneek: botsnack
<sneek>:)
<avv>Hey. I have an issue with web requests and I can't seem to find a solution online. When I receive a request with a body, and try to read it with read-request-body, it blocks for a while until the client times out. It hangs endlessly even by sending with curl on the local machine. Has anyone had the same problem?
<avv>The relevant manual page: https://www.gnu.org/software/guile/manual/html_node/Requests.html#index-write_002drequest
<avv>Nvm im really dumb. The web server handler already has a body parameter haha