IRC channel logs

2023-12-12.log

back to list of logs

<cow_2001>is there a way of listing all form definitions in the interactive interpreter?
<apteryx>oops! "lawful purpose" is found in a license in module/ice-9/psyntax.scm
<apteryx>isn't that incompatible with the GPL (which gives you unlimited permission to run the unmodified program)
<apteryx>it also appear in SRFI 125, which bothers me, as I'd like to add it
<isaneran>is there a way to supress the printing done by (system ...) ?
<dthompson>I would imagine changing the current output/error ports would do it
<isaneran>ah maybe it's the error port then
<isaneran>hmm no does not seem like it is either of them
<janneke>no, you'll have to change the fdes for stdout and/or stderr
<dthompson>ah that's right. lower level.
<janneke>isaneran: for stderr (2), try something like
<janneke>scheme@(guile-user)> (open-output-file "err")
<janneke>$1 = #<output: err 13>
<janneke>scheme@(guile-user)> (move->fdes $1 2)
<janneke>$2 = #<output: err 2>
<janneke>scheme@(guile-user)> (system "ls /foo /bin")
<isaneran>hmm no it seems like it is still printing to the console
<isaneran>though maybe that is geiser screwing with me
<janneke>(to state the obvious, stdout still prints to the console in my example above)
<isaneran>janneke: ah, it could be that the thing was just printing to stdout then rather than error
<janneke>yep, you'd need a (move->fdes <port> 1) for that
<isaneran>yeah
<isaneran>thanks!
<isaneran>find the naming of that procedure a bit strange but
<isaneran>it is what it is
<sneek>dsmith-work: wb!!
<dsmith-work>sneek, botsnack
<sneek>:)
<festerdam>Hi, all!
<festerdam>You don't do scheme code reviews on here, do you?
<Arsen>why not
<dsmith-work>festerdam, People can be busy, but if you ask, someone might be able to take a look..
<festerdam>Thanks! I guess I will see if someone can comment on my code at https://gitlab.com/Festerdam/festerdam-aoc2023/-/blob/master/day02/day02-1.scm . It should be noted that this is the advent of code 2023 solution for day 2, part 1, so don't look at it if you still want to solve it yourself. I implemented a lot of stuff myself and was wondering if
<festerdam>there are some of guile's features that I do not know about that could simplify my code. The problem I'm trying to solve can be found here: https://adventofcode.com/2023/day/2 . I'm currently on a train, so it's likely I will lose the connection sometime, but I'll be looking at the channel logs, so you can answer me even if I'm offline.
<festerdam>There's also a part 2 solution, but I don't think you can see the task I'm trying to solve without submitting the solution for part 1, so I won't link my part 2, since you lack the necessary context to understand what I'm trying to do.
<festerdam>Thanks a lot!
<festerdam>The reason I'm asking for this review, is because I'm planning to do something bigger with guile, but I still do not feel confident in my skills, so I'd like to know the things I should do better in my future code.