IRC channel logs

2023-05-29.log

back to list of logs

<wingo>got soft ports and r7rs textual ports on top of "custom ports". should be suspendable too. pushed to wip-custom-ports
<wingo>*r6rs textual ports
<rgherdt>is there a way to get `guild compile` to output locations of errors found? For example I get: "<unknown-location>: warning: possibly unbound variable ..."
<rgherdt>I implemented diagnostics for my LSP server by `load'ing the file, but I wonder if there's a better way for getting useful information
<wingo>rgherdt: it should output locations... if you have a test case that produces this error do file a bug
<wingo>provided your guile is new enough (there were some read changes a couple years ago)
<rgherdt>wingo: indeed, I just tried with 3.0.9 and it worked, thanks! I was using 3.0.8 I think, but maybe there was a problem with my installation
<wingo>yay :)
<dokma>I'm going nuts for weeks trying to connect to a websocket using guile-websocket...
<dokma>Nothing I try works. I always get 400 Bad request
<dokma>Has anyone actually used guile-websocket?
<dokma>Guile 3.0.9
<mirai>Does my use of cons at line 50 <https://paste.centos.org/view/17221136> break some unspoken rule about SRFI-171 transducers?
<mirai>am trying to get started with transducers by writing a INI-file serializer with it
<rlb>dokma: don't know anything about it myself, though glancing, if you're using 0.1, looks like there's been a client commit or two since then: https://git.dthompson.us/guile-websocket.git I'd also wonder if the client were well tested, commonly used, etc., but again, no nothing about the lib.
<rlb>Did idly wonder if the 400 could be related to the client "secure websockets" commit there.
<mwette>mirai: are you sure about caar? Maybe add a (tmap (lambda (x) (pretty-print x) x)) before that to debug
<mwette>s/before that/before (tmap add-section-header)
<mwette>or (tmap pk) better yet
<mirai>caar is right
<mirai>since it happens after tpartition
<mwette>I get it.
<mirai>what I'm concerned about the cons is if using it like that ends up being wasteful when considering the context within transducers
<mirai>s/within/of
<mwette>I don't see how it would be.
<dokma>rlb: I pulled and now it works. Thank you!
<rlb>certainly
<dokma>Now I'm pulling my hair as to why my assoc-ref works in the repl but not in my code:
<dokma> (display (format #f "~a" (assoc-ref (cdr (car json-data)) 'c)))))
<dokma>
<RhodiumToad>json-data looks like what?
<dokma>this doesn't work in code (the assoc-ref part)
<RhodiumToad>specify "doesn't work"
<dokma>((B . 0) (Q . 37036.77824760) (V . 1.33806000) (q . 51340.96441860) (x . #f) (n . 79) (v . 1.85484000) (l . 27679.45000000) (h . 27679.46000000) (c . 27679.45000000) (o . 27679.45000000) (L . 3129160849) (f . 3129160771) (i . 1m) (s . BTCUSDT) (T . 1685393879999) (t . 1685393820000))
<dokma>This is the alist.
<dokma>The code just prints #f#f#f
<dokma>Whereas if I remove the assoc-ref it prints the alist.
<RhodiumToad>how was the alist built?
<dokma>RhodiumToad: I fetched it from Binance using guile-websocket
<dokma>Let me pastebin
<dokma> https://pastebin.com/4d6djr2e
<dokma>The pasted version works (prints each alist it fetches). But if I add assoc-ref it just prints #f#f#f
<dokma>I tried assq assv and assoc
<RhodiumToad>was just going to ask about assq
<dokma>Do you have guile-websocket installed?
<RhodiumToad>no
<RhodiumToad>change the ~a to ~s and see what it prints
<dokma>(("B" . "0") ("Q" . "20363.59195920") ("V" . "0.73563000") ("q" . "51895.96451220") ("x" . #f) ("n" . 100) ("v" . "1.87473000") ("l" . "27681.83000000") ("h" . "27681.84000000") ("c" . "27681.84000000") ("o" . "27681.83000000") ("L" . 3129162634) ("f" . 3129162535) ("i" . "1m") ("s" . "BTCUSDT") ("T" . 1685394299999) ("t" . 1685394240000))
<dokma>So those are not symbols?
<RhodiumToad>~a doesn't distinguish between symbols and strings
<RhodiumToad>those are strings
<RhodiumToad>(assoc-ref ... "c") should work then
<dokma>Damn...
<dokma>yes it works
<dokma>Thanks a bunch!
<RhodiumToad>note that you need assoc-ref rather than assq-ref or assv-ref, because strings need equal? for comparisons
<dokma>That's what I used once I figured out those were strings.
<dokma>That ~a print deceived me
<RhodiumToad>~a is like (display ...) whereas ~s is like (write ...)
<dokma>RhodiumToad: thank you
<mwette>mirai: thanks for the srfi-171 intro -- looks super useful