(define ipc:call
(lambda (process . args)
(let* ((callback-proc (ipc:get-process-name))
(func (if (string? (car args))
(begin (set! callback-proc (car args))
(set! args (cdr args))
(car args))
(car args))))
(let loop ((i *ipc:active-label-cnt*))
(if (not (null? (vector-ref *ipc:active-labels* i)))
(loop (modulo (+ i 1) *ipc:active-label-buffer-size*))
(set! *ipc:active-label-cnt* i)))
(apply ipc:call-async process 'ipc:sync-receive callback-proc
*ipc:active-label-cnt* func (cdr args))
(let ((return-val (call/cc (lambda (k)
(vector-set! *ipc:active-labels* *ipc:active-label-cnt* k)
(*sys:toplevel-continuation* 0)))))
return-val))))