Hey Richo,

thanks for your contribution to the Chicken ecosystem!

richo <[email protected]> writes:

> I'd love a) For people to use it, and b) feedback on the code.

As for a), I'm not an OS X user so I can't but as for b) I figured I can
give you a small hint:

> (define (send datum thunk)
>   (call/next-id (lambda (id)
>     (register-callback id thunk)
>     (with-output-to-port zeph-out (lambda ()
>       (let* ((payload (apply vector id datum))
>              (json-payload (json->string payload)))
>         (write-string json-payload)
>         (write-string "\n"))))
>     id)))

Here you can just immediately serialize JSON into the output port using
`(write-json payload)`. Also, I would advise you not to use
`with-output-to-port` but instead pass the port to write calls
explicitly as implicitly redirecting output can be a source of very
subtle bugs :-)

I'm not sure I understand how `send-get-value` works. It kind of looks
too clever to me but maybe I'm missing something.


Moritz

_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to