IRC channel logs
2023-03-13.log
back to list of logs
<mirai>old: its the http server that misbehaves :) <mirai>occasionally it just stops answering to API requests <mirai>rekado: I was looking at them <mirai>I was wondering why is guile (web client) not reusing the guix open-socket-for-uri implementation <ArneBab>civodul: did you see my email about separating the merge of srfi-119/wisp from changing language handling (because the discussion about the latter got out of hand — as somehow expected)? There’s a wip-branch for language handling, but I think srfi-119/wisp is ready without that. <RavenJoad>Before I make a silly decision, does it make sense to build a parser for BibTeX and BibLaTeX files using the (ice-9 peg) module? Or should I use (system base lalr)? <old>mirai: okay. Well the code I gave should be able to timeout on given http requests <old>it's an unperfect solution but it should work for your use case I think <mirai>old: silly question but where/how exactly do I set the timeout value? <RavenJoad>Is there a convenient way to tag an already defined PEG class (namely peg-any) and remove a character from it? I am trying to match on a string of the form "{anything%can?go)here}", where anything is allowed between the { and }. <flatwhatson>RavenJoad: anything except } can go there? "!}" or (not-followed-by "}") <RavenJoad>flatwhatson: For now, yes. I think BibTeX allows you to escape when inside the { with a "\}" symbol, but I am ignoring that for now. <RavenJoad>I'm doing the sexp route, so not-followed-by is probably what I want. <flatwhatson>(and "{" (* (and (not-followed-by "}") peg-any)) "}") <flatwhatson>to support embedding \}, you can do this: (and "{" (* (or "\\}" (and (not-followed-by "}") peg-any))) "}") <RavenJoad>flatwhatson: Thank you. After your initial not-followed-by hint, I got it. (and (ignore tag-value-delimiters) (* (and (not-followed-by tag-value-delimiters) peg-any)) (ignore tag-value-delimiters)) <RavenJoad>I tried your "\\}" one and the parser throws an error "invalid character in escape sequence: #\}". I am not too worried about it though. That escape symbol does not show up that much. <flatwhatson>did you double-backslash, or single? single backslash gives that error, because "\}" is not an escape <RavenJoad>I did double-backslash. The entire sequence was (and (ignore tag-value-delimiters) (* (or "\\}" (and (not-followed-by tag-value-delimiters) peg-any))) (ignore tag-value-delimiters)) <flatwhatson>oh, perhaps your input string to test with you put "\}" instead of "\\}"? <flatwhatson>that double-slash is necessary to appease guile's string reader <RavenJoad>That is what it was. The input string only had "\}", not "\\}" in it. <RavenJoad>Is there a way to explore/find how to define certain characters? Like the - or _ characters. <RavenJoad>Wait, I am just silly. I tested #\- in a REPL and it did not error out. <RavenJoad>I guess I was asking if there is a way to query/search for character representations. <kreyren2>I am writing a software specification.. What is the way in GNU Guile to get a list of available definitions? e.g. if i declare (define (kreyren) ...) to get a list of that <kreyren2>ACTION figured out `(hash-map->list cons (struct-ref (current-module) 0))`, but ain't sure if that's the least stupid way <rekado>kreyren2: you can use module-map / module-for-each, which are a little more descriptive than using the hash-map->list thing. <kreyren2>rekado: where do you get those? it's not returned from `info guile` <rekado>they are in boot-9; they really should be mentioned in the manual but are not. <rekado>(you don’t need to import anything to get these) <kreyren2>ACTION goes to check source code for usage then <kreyren2> (hash-map->list proc (module-obarray module))) <kreyren2>ye the (module-map cons (current-module)) seems more clean thanks <msavoritias>Is there any ui toolking besides gtk for guile? Thinking something like CLIM for Common Lisp <msavoritias>you can use gtk though g-golf but was wondering if there was something "native" <old>mirai: `make-timeout-wrapper' takes a procedure a wrap it with a timer. it returns a procedure that takes two arguments and the rest of the arguments are given to the real procedure <old>`(define http-get/timeout (make-timeout-wrapper http-get))' <mirai>Interesting, guile (web client) seems to be ipv4 only? <mirai>raw IPv6 address works though <old>mirai: Have a look at the definition of open-socket-for-uri. It's the procedure used for opening a socket <mirai>what's the correct way to perform the equivalent of a >/dev/null for something launched with (system* ...) ? <mirai>Is this supposed to cause a segfault in guile 3.0.9? > (spawn "uname" '("uname" "-a") #:output (%make-void-port "+")) <mirai>it just segfaults left and right, no matter the make-void-port argument <civodul>mirai: there's an embarrassing bug in spawn, that's fixed in "main" <mirai>civodul: ah right, that explains it