ryanc
2017-12-12 13:31:03

@mflatt is there a reason the docs for unsafe-poller say the polling function should return a list to indicate the event is ready? The implementation seems to accept any non-false value. (And I originally assumed that the “list of results” would get turned into multiple values, but that doesn’t seem to be true either.)


mflatt
2017-12-12 15:07:45

The docs and your assumption are right, and the implementation is wrong


mflatt
2017-12-12 15:08:03

(It’s meant to match the Racket-on-Chez implementation.)


mflatt
2017-12-12 15:09:27

I’ll fix the implementation, but support a non-list single-value result to smooth the transition


ryanc
2017-12-12 15:16:18

@mflatt thanks! Another question: is there a (cheap, direct) way to check if a custodian is shut down? The context: if I call scheme_make_fd_output_port when the current custodian is already shut down, I get a segfault. This is a problem for unix-socket-{connect,accept}.


mflatt
2017-12-12 15:17:38

register-custodian-shutdown from ffi/unsafe/custodian does that check for you, and it returns #f if the custodian is shut down. I think that check is a relatively new feature, though.


ryanc
2017-12-12 15:17:52

BTW, thanks for unsafe-poller; with it, I should be able to add unix-socket-accept-evt


ryanc
2017-12-12 15:20:40

I don’t have a separate callback I want to register; I just want to safely rely on custodian-registration work that scheme_make_fd_output_port already does.


mflatt
2017-12-12 15:21:56

Oh, I see. The right answer here is to add a Racket function so your code can work with Racket-on-Chez. Are there other C functions that you’re using?


ryanc
2017-12-12 15:24:02

For this library, that and scheme_fd_to_semaphore


shu--hung
2017-12-12 19:13:21

Is there any good way to iterate over a list in pairs other than writing a loop? (Iterating through a list of form (prop prop-val ... ...))


notjack
2017-12-12 19:15:30

@shu—hung I just know there’s a library function somewhere that does that



notjack
2017-12-12 19:16:13

that’s the one


shu--hung
2017-12-12 19:16:16

oh that’s nice! thanks @notjack @lexi.lambda


jimmyruska
2017-12-13 01:04:58

@jimmyruska has joined the channel


me1
2017-12-13 05:40:48

is it possible to have a macro where usually (function xyz) becomes (list “x” “y” “z”) but “wz” is a special combination and (function xywz) becomes (list “x” “y” “wz”) ?


lexi.lambda
2017-12-13 05:42:24

Sure. That’s just a string processing problem.