
@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.)

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

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

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

@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}
.

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.

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

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.

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?

For this library, that and scheme_fd_to_semaphore

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 ... ...)
)

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

@shu—hung in-slice
will do it http://docs.racket-lang.org/reference/sequences.html#%28def._%28%28lib._racket%2Fsequence..rkt%29._in-slice%29%29

that’s the one

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

@jimmyruska has joined the channel

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”) ?

Sure. That’s just a string processing problem.