IRC channel logs

2016-05-18.log

back to list of logs

***frofroggy1 is now known as frofroggy
<zRecursive>How to remove the ^M of a string ?
***Shozan is now known as SHODAN
<ArneBab_>should I re-fill changed paragraphs in doc/ref/guile-invoke.texi?
***ecraven- is now known as ecraven
<roelj>I'm trying to run a command from Guile with: (status:exit-val (system* guile-bin "-c" (format #f "~s" "my-expression"))) . Unfortunately, it does not work. Running the command manually works though.
<roelj>What am I missing?
<taylan>roelj: I think you need to use ~a instead of ~s, or something
<taylan>well no, I'm probably wrong
<taylan>yeah, I was testing it wrong. this works for me:
<taylan>scheme@(guile-user)> (status:exit-val (system* "guile" "-c" (format #f "~s" '(exit 1))))
<taylan>$18 = 1
<taylan>what exactly fails for you? are you sure that the argument you pass to 'format' is a sexpr, and not a sexpr-in-a-string? (in the latter case you need to use ~a)
<taylan>(well, the whole 'format' is redundant in that case)
<roelj>Where, here's the full command I'm trying to run: /gnu/store/hyk2i7b8mwbrbiyqk5sgrfgds9zvcrn5-guile-2.0.11/bin/guile --no-auto-compile -c "(begin (unless (access? \\"/home/roel/pipelines/rnaseq-out\\" F_OK) (mkdir \\"/home/roel/pipelines/rnaseq-out\\")) (map-in-order mkdir (quote (\\"/home/roel/pipelines/rnaseq-out/rnaseq-initialize-2016-05-18\\" \\"/home/roel/pipelines/rnaseq-out/rnaseq-initialize-2016-05-18/read_counts\\"
<roelj>\\"/home/roel/pipelines/rnaseq-out/rnaseq-initialize-2016-05-18/logs\\" \\"/home/roel/pipelines/rnaseq-out/rnaseq-initialize-2016-05-18/jobs\\" \\"/home/roel/pipelines/rnaseq-out/rnaseq-initialize-2016-05-18/DEanalysis\\"))))"
<roelj>So, the sexpr is a quoted string, which I then quote again to pass it as a quoted string to the system* call.
<taylan>roelj: (format #f "~s" "my-expression") returns "\\"my-expression\\"", which with -c just evaluates to the string "my-expression"
<roelj>So what if the expression is (display "Hello").
<taylan>(system* guile "-c" '(begin ...)) would be the right way. or if you already have a string, just (system* guile "-c" string)
<roelj>Oh
<roelj>let me try
<taylan>(system* guile "-c" '(display "hello"))
<taylan>er
<taylan>(system* guile "-c" (format #f "~s" '(display "hello")))
<taylan>so many layers :)
<roelj>Haha
<roelj>It works
<roelj>thanks a lot!
<taylan>:)
<davexunit_>why would you ever shell out to guile when you're running guile already?
<roelj>davexunit_: Good question. I'm trying to do this with other interpreters as well.
<roelj>davexunit_: For Guile I can directly execute the code, but for Python, I will have to shell out.
<davexunit_>okay
<davexunit_>whatever works for ya
<davexunit_>it's just a good general rule to shell out only as a last resort.
<roelj>It's called "shelling out" for a reason, heh
<davexunit_>;)
<ArneBab_>roelj: for Python you should be able to exec(codestring)
<roelj>ArneBab_: Oh really.. Let me read about exec :)
***petercom1and is now known as petercommand
<wingo>pew pew
<wingo>so no thoughts on my async io in guile screed then
<davexunit>I don't have anything constructive beyond "hell yeah!"
<wingo>:)
<wingo>i am thinking the scheme port implementation, which should basically be the only caller of port read functions from scheme, should always be nonblocking
<wingo>write functions too
<wingo>so the read/write functions from scheme's perspective will return two values, the number of bytes read/written and a waiter, or #f
<wingo>s/waiter/waitable/ or maybe s/waiter/completion/, dunno
<ArneBab_>wingo: will I have to adjust wisp for this?
<wingo>ArneBab_: no
<ArneBab_>good :)
<wingo>this is much lower level, like below read-char
<ArneBab_>thank you!
<wingo>:)
<dsmith-work>wingo: make check report:
<dsmith-work>Running sports.test
<dsmith-work>ERROR: In procedure read:
<dsmith-work>ERROR: In procedure scm_lreadr: tests/ports.test:793:30: unknown character name ??
<dsmith-work>wingo: v2.1.2-108-ge32dcf2
<wingo>weird, i thought i fixed that
<wingo>ACTION looks
<wingo>evidently my fix to that didn't make it in
<wingo>d'oh
<dsmith-work>;^)
<wingo>dsmith-work: fixed, tx for the report
<wingo>it was just a prob in the test so no need to rebuild fwiw
<wingo>err
<wingo>ok done now :)
<dsmith-work>Yey!
<wingo>janneke: is HANDLE on windows always the same as int?
<wingo>or i guess it's an unsigned int
<wingo>i am wondering what the canonical value for a bad HANDLE is
<wingo>like -1 for file descriptors
<janneke>wingo: oh...i've no idea, sorry
<wingo>i thought you were the person that knew all the things janneke
<janneke>ACTION is such a terrible encyclopedia
<wingo>:)
<janneke>i'm working to write a truly minimal lisp interpreter in assembly -- prototype in C can almost interpret itself now
<wingo>nice!
<janneke>i'm learning even more how amazing lambda is, scheme/lisp is so amazing
<davexunit>ACTION once again thinks about a Scheme-like->GLSL compiler
<ArneBab_>janneke: cool!
<ArneBab_>janneke: doing that in assembly means, you could use it for bootstrapping something bigger
<janneke>ArneBab_: that's the idea...Hmm, how about bootstrapping some kind of operating system?
<ArneBab_>as soon as you’re at a point where you can build a C compiler which can build an old GCC, you’ve effectivelyl bootstrapped anything you like
<ArneBab_>well… maybe as first step a simple sh and an m4 interpreter to be used by autotools
<ArneBab_>lisp→sh+m4+make→anything else
<janneke>ArneBab_: a friend of mine is working on a sh interpreter in guile
<ArneBab_>janneke: could you push your lisp in assembly fare enough that it can run the sh interpreter?
<ArneBab_>fare->far
<janneke>but yeah, parsing a tiny c compiler would be the big next target
<janneke>ArneBab_: i'm not sure...i looked at psyntax.pp and that realy scared the bejezus out of me
<janneke>*really
<ArneBab_>:)
<janneke>probably you don't need all of modern define-syntax for to process PEG?
<ArneBab_>PEG?
<janneke>see the manual: 6.18 PEG Parsing
<ArneBab_>ok, thanks
<ArneBab_>parsing expression grammars — got it :)
<janneke>:-)
<janneke>ACTION -> zZzz
<paroneayea>hello
<ArneBab_>wingo: here’s the patch for the -e '()' doc: http://lists.gnu.org/archive/html/guile-devel/2016-05/msg00027.html