IRC channel logs
2022-01-21.log
back to list of logs
<ArneBab>sneek: later tell vijaymarupudi thank you! <sneek>tohoyn, daviid says: i just pushed another important fix, on the master branch ... <wingo>zap: (1) char-ready? just checks if there are bytes in the buffer or if select() returns true. for custom ports i don't know if the "select" logic carries through. so that's one thing <wingo>the other is that select would return true if there's a byte but characters can be multibyte <wingo>looking at the impl, custom binary input/output ports don't implement the "input_waiting" callback and so char-ready? always returns #t <wingo>zap: so i am not sure exactly what to do, ideally also you want to be able to poll() on these ports... i think we never fully solved the fibers/suspendable-ports + custom ports issue <civodul>wingo: didn't we get a custom port implementation in Scheme? <wingo>civodul: iirc we got something really close. when you make a custom port, the read and write callbacks are present in both scheme and c (iirc) <wingo>the c port implementation calls the c callbacks. the scheme version calls the scheme callbacks. they should do the same thing -- one should be the wrapper of the other iirc. <wingo>so if you have suspendable ports installed (something we should ensure is always the case, in guile 3.2, if we can manage it), then there's no continuation barrier when reading from a port <wingo>but, there is the input_waiting vtable method on ports which isn't implemented in scheme at all, and in practice is only implemented for fports, where it delegates out to a quick call to poll(2) <wingo>civodul: sry to bother but i would try your test case with making the optimization keywords #f rather than simply removing them <civodul>wingo: you mean adding #:kw #f to the front of the optimization alist? <civodul>building's gonna take a while, but i can do that <wingo>or otherwise not simply removing the #:kw #t from the list <wingo>just worried that the optimization-level defaults were then taking precedence if the kw wasn't in the list at all <civodul>yeah i can both remove and add to the front, for good measure <civodul>my reading of the code was that it was okay <wingo>my reading of (language tree-il optimize) was the reverse; see line 82 <wingo>i could be misunderstanding your setup, of course <civodul>oh right, i was looking at 'lookup' above, which does (and (assq-ref opts kw) ...) <zap>wingo: thanks for the answer <zap>I'm pretty lost in gnutls and guile ports now... :) <zap>Am I right in that if I set a port to be non-blocking with fnctl than select call should block on a port? <zap>civodul: Then Im out of ways to check whether I can read a port :) Gnutls guile bindings have this session-record-port that is used to do reads and writes on tls socket. Its representation is soemething like #<input-output: xxx> and I can't coll select on it nor I can check fileno... But port? returns #t <zap>The weird part is that when I run select on wrapped socket it blocks <civodul>zap: ah wait, a session record port is not a file port, so it may be different <civodul>session record ports do implement the input_waiting callback though <zap>char-ready? does work but it always returns #t so not very useful <mwette>on MacPorts, when I "port install gnutls +guile" the guile extension does not get installed :( -- checking to see if it is built <civodul>wingo: peak at 2.1 GiB resident this time, so no real difference it seems <mwette>FYI, I filed a macport ticket for gnutls+guile: #64490 <Zambyte>Hi, does anyone know how to check if an optional parameter is defined in some C code? I tried using `if (scm_is_false(my_SCM_arg)) { ... not defined ...} else { ... is defined ...}` but that doesn't seem to work for me <Zambyte>If I do that I get this error when I don't pass the argument: `uncaught exception: In procedure list-ref: Wrong type argument in position 1: #<undefined>` <dsmith-work>Zambyte: Pretty sure a missing optional parameter arrives as SCM_UNDEFINED in C code. <Zambyte>dsmith-work: hmm, I just tried `if (scm_is_false(scm_eq_p(my_SCM_arg, SCM_UNDEFINED))) {...}` and I got the same issue <Zambyte>I'm dumb, I had my condition backwards. It works now :D <dsmith-work>#define SCM_UNBNDP(x) (scm_is_eq ((x), SCM_UNDEFINED)) <bsima>say earlier I defined a function at the repl, how can i print the source of the definition i wrote?