IRC channel logs

2017-10-14.log

back to list of logs

<Apteryx>Is there anything to understand in this: http://paste.lisp.org/display/358552
<Apteryx>Basically I get different exit status from the same command, depending whether it ran from system* in Guile or under bash directly.
<Apteryx>The same exit status 256 also happens when using system instead of system*
<Apteryx>Better: guile -c '(let ((status (system "exit 1"))) (format #t "exit status: ~a~%" status))' -> exit status: 256
<Apteryx>:D
<daviid>Apteryx you must call status:exit-val
<daviid>(let ((status (system "exit 1"))) (format #t "exit status: ~a~%" (status:exit-val status)))
<Apteryx>Ah, I see. Thanks for saving me the shame of posting my erroneous finding as a guile bug ;)
<Apteryx>with-output-to-string doesn't seem to capture stdout from system* commands. Is this expected?
<davexunit>yes
<Apteryx>OK :/
<Apteryx>It works with "with-output-to-file" though.
<davexunit>'system' is a wrapper around the POSIX call of the same name
<davexunit>and it does not capture output
<davexunit>you should use a pipe
<Apteryx>ACTION reads about pipes
<dustyweb>if only our pipe situation was better
<dustyweb>or at least if only our stdin / stdout / stderr situtation was better
<Apteryx>How can I hook a pipe to a system* command?
<davexunit>you don't
<davexunit>section 7.2.10 in the manual explains
<Apteryx>Thanks. I though 7.2.2 Ports and File Descriptor was all there was, eh.
<Apteryx>It works very well for capturing stdout. Now back to pondering about stderr.
<Apteryx>Seems a workaround is to use the private open-process from (ice-9 popen).
<Apteryx>How can I sort a list of structs base on one of its slot?
<Apteryx>The slot in question is a string, so I would use string<?, but what I wonder is how to tell it that the thing to look at is not the struct itself but rather (struct-my-field struct).
<Apteryx>I guess I can come up with a 2 args lambda for LESS (3rd arg of sort) that will do: (lambda (y x) (string<? (struct-my-field y) (struct-my-field x)))
<Apteryx>or rather (lambda (x y) ...
<rekado_>I’m trying to run some code on a remote machine with guile-ssh’s node-eval.
<rekado_>unfortunately, nothing appears to happen and the local process seems to wait forever
<rekado_>is there a way to make guile-ssh more verbose, or to redirect the remote stdout to the local machine?
<daviid>rekado_: never used guile-ssh yet, but isn't there some examples you could look at? there is an examples subdir ...
<daviid>rekado_: it seems there is uptop.scm (see the README in that examples subdir), didn't try it though
<Apteryx>Is there anything is Geiser or other tool to flag unnecessary use-modules lines?
<Apteryx>It's not trivial to figure out what use-modules are required after removing some code from a module without a tool.
<Apteryx>I guess it wouldn't be too hard to create such a tool for Guile; if it doesn't exist I might just create one but otherwise don't want to reinvent the wheel :)
<Apteryx>Seems there's a linter named "guile-lint": http://user42.tuxfamily.org/guile-lint/guile-lint.html
<Apteryx>It's supposed to support this check :) "Modules which are imported but then don't have any bindings used are warned about."
<happy_gnu[m]>Apteryx: that's very interesting
<Apteryx>It's only available up to Guile 1.8 currently though. Also, on the page gnu.org/software/guile/libraries, it is written that "Guile 2.0 brings part of Guile-Lint's functionality through its compiler warnings.".
<dustyweb>civodul: I wonder if you patched out the new weak hashtable system and just put in the old one if that would clear up most of the memory problems we're hitting, based on all you've said on-list?
<jherrlin>Hey folks, i am about to write a procedure that takes a list as argument and write it, item by item to a file. Anyone have a snippet for that? Or can help me with my attempt. http://paste.lisp.org/+7OQ9
<happy_gnu[m]>jherrlin: does it work?