IRC channel logs

2021-08-18.log

back to list of logs

<apteryx_>vijaymarupudi: about redirecting both standard output & error, I just chained the with-output-to-port & with-error-to-port. Ugly, but does the job.
<vijaymarupudi>Haha, I guess that does the job
<muradm>hi guile
<muradm>currently i use (execl prog1 ...) in my script, what would be the way to do the same but with stderr and stdout redirected to /dev/null?
<muradm>i look at popen, but it is not same as execl
<apteryx_>are here GNU Mcron users here?
<apteryx_>are there*
<vijaymarupudi>muradm: I would open /dev/null as an output file port, and use dup2 to replace the 1 and 2 file descriptors with the file description from /dev/null
<muradm>vijaymarupudi: before (execl ...) ?
<apteryx_>yes
***apteryx_ is now known as apteryx
<vijaymarupudi>^
<muradm> https://paste.rs/6m3
<muradm>like this?
<muradm>there is a type however dev-null should be dev-null-out
<muradm>no (open-output-file ...) does not return fd
<muradm>will this work for instance? https://paste.rs/D45 when call-with-output-file will close the handle?
<apteryx>yuor dup2 are inverted
<apteryx>you want old to be the fd of /dev/null
<apteryx>so that it copies its fdes into that of fdes 1
<apteryx>so [...] (dup2 (port->fdes dev-null-out) 1) (dup2 1 2) (execl [...])
<flatwhatson>i've hacked together a working package & service definition for LXD
<flatwhatson>(wrong channel sorry)
<vijaymarupudi>Q: Is there a way for me to fully expand the input to a syntax-case macro before I operate on it?
<leoprikler>vijaymarupudi: call macroexpand?
<RhodiumToad>I think you'd want to think hard about why you think you want to do that
<vijaymarupudi>macroexpand seems to become either tree-il or just a datum, while ideally I would like a syntax object
<vijaymarupudi>RhodiumToad: I want to make a macro that is user expandable, i.e. they can create their own macros that expand into the primitives accepted by my macro
<vijaymarupudi>I believe racket has this: https://docs.racket-lang.org/reference/stxtrans.html#%28def._%28%28quote._~23~25kernel%29._local-expand%29%29
<vijaymarupudi>But I really want to use guile
<RhodiumToad>can you give an example of the kind of usage you want to allow?
<RhodiumToad>macroexpand does indeed expand to tree-il
<RhodiumToad>I believe there's no seperable part of guile to expand to a syntax object
<vijaymarupudi>Something like this, I want them to be equivalent https://paste.gnome.org/pognnq4sz
<vijaymarupudi>This is kind of an artificial example, my actual use case is to create a cognitive model that I can describe using such macros
<stis>tja guilers!
<dsmith-work>Morning Greetings, Guilers