IRC channel logs

2016-09-13.log

back to list of logs

<sapientech>OrangeShark: updated it btw, thanks
<civodul>Hello Guilers!
<wleslie>hey ludo!
<civodul>(format #f "foo~@\\n bar")
<civodul>$3 = "foo\\nbar"
<civodul>crazy stuff no?
<civodul>and i thought i knew (ice-9 format)...
<iyzsong>oh, it's an undocumented feature? :-)
<wingo>civodul: wow, new to me too :)
<dsmith-work>Morning Greetings, Guilers
<davexunit>I was bummed to learn that I can't make a keyboard with a lambda key without altering the keyboard layout on the machine that the keyboard is plugged into
<davexunit>ACTION was hoping to make a keyboard with some features of the symbolics space cadet keyboard
<paroneayea>whee
<paroneayea>davexunit: aw
<paroneayea>davexunit: well, you could probably bind to some keycode and either use xmodmap or at least some emacs binding to make it a reality :)
<davexunit>paroneayea: yeah, but it defeats my goal of having a keyboard that "just worked" like this
<davexunit>my basic plan was to replace the left control key with a special function key, so that, say, the "L" key would insert a lambda or something
<paroneayea>ACTION adds keys to define/expand macros
<paroneayea>wow! typing that sentence just made me remember that geiser has a macro expand command. I forgot!
<davexunit>:)
<paroneayea>time to get on this standards call...
<paroneayea>I'm going to be advocating for making all CR-blocking issues to be filed on ActivityPub
<paroneayea>translation: shit's gonna get real
<davexunit>:)
<davexunit>good luck!
<amz3`>There is a conversation about a free search engine over at HN
<amz3`> https://news.ycombinator.com/item?id=12486631
<amz3`>they say they need 300€ per month to keep it running
<amz3`>I think I abandon for the time being the idea of concept search and focus and making public a search engine...
<janneke>how do i junk output from system invocation that's not under my control?
<janneke>$ guile -c '(with-output-to-file "/dev/null" (lambda () (system "echo hallo")))'
<janneke>hallo
<janneke>
<DeeEff>I wrote this on my other client but I'm not sure it sent:
<DeeEff>janneke: I believe you should be calling `$ guile -c '(my-command ...)' 2>&1 > /dev/null`
<DeeEff>that said, if you want to keep messages on standard error omit the "2>&1" part
<janneke>DeeEff...sure ehm; i want to get rid of system's output /within/ guile already
<davexunit>you can also change what file descriptor STDOUT is
<davexunit>which is what you'd want here.
<davexunit>refer to the POSIX section of the manual
<janneke>davexunit: that sounds great...i tried with-output-to-file and such...
<davexunit>with-output-to-file doesn't change stdout
<davexunit>it changes the current output port parameter in guile
<janneke>yes...
<janneke>i see
<davexunit>a child process will still write to STDOUT
<davexunit>you'll need to use the POSIX interface to change that
<janneke>primitive-move->fdes or so i guess... thanks!
<davexunit>I would fork, open /dev/null and set stdout (fdes 0 or 1, I always need to look it up) and exec
<DeeEff>stdin is 0, stdout is 1, stderr is 2
<davexunit>thanks :)
<davexunit>so fdes 1 would need to be changed
<janneke>davexunit: hmm...the `system' call is done in another guile library that i don't want to change for now
<janneke>i'm just calling a function...
<davexunit>then you can change stdout, call the procedure, and then change it back to what it was before
<DeeEff[m]>you could even write a macro for it if it's common
<davexunit>a procedure would work
<janneke>yay! thanks davexunit!
<janneke>21:46:08 janneke@dundal:~/src/cuirass [env]
<janneke>$ guile -c '(move->fdes (open-file "/dev/null" "w") 1) (system "echo foo") (move->fdes (current-output-port) 1) (system "echo bar")'
<janneke>bar
<janneke>
<davexunit>nice
<davexunit>add an abstraction with dynamic-wind and you are golden
<janneke>i wanted to have (with-junk-output/error) for quite some time now :-)
<janneke>but always worked around it
<DeeEff[m]>davexunit: a procedure would work, but this seems analogous to "call-with-x-port" vs "with-x-port"
<janneke>dynamic-wind... hmm
<DeeEff[m]>so a procedure that takes a thunk and a macro
<davexunit>DeeEff[m]: right.
<davexunit>best to make a procedure with a thunk and then add sugar on top
<janneke>:-)
<davexunit>then you have programmatic and syntactic ways of using it
<DeeEff[m]>I'd call it something like `(call-with-fdes fdes new-file thunk)`
<DeeEff[m]>and then write a macro `(with-fdes fdes new-file body ...)
<DeeEff[m]>`
<DeeEff[m]>but you're right, having both is good.
<DeeEff[m]>maybe even `call-with-fdes-as` and `with-fdes-as` would be better. Anyways, it's a minor detail.
<davexunit>naming is hard
<DeeEff[m]>Nah it's easy. Naming things _well_ is hard :D