1 (in-package :cl-cluster
)
3 (defmacro with-remote
(node &body body
)
4 "Execute body at remote host."
5 `(node-exec ,node
(format nil
"~s" '(progn ,@body
))))
7 (defmacro send-remote
(node &body body
)
8 "Execute body at remote host."
9 `(node-exec ,node
(format nil
"~s" '(progn ,@body
)) nil nil nil
))
11 (defmacro exec-remote
(node &body body
)
12 "Execute body at remote host."
13 `(node-exec ,node
(format nil
"~s" '(progn ,@body
)) nil t t
))
15 (defmacro rplet
(node (&rest bindings
) &body body
)
16 "Let-like macro for remote lisp. Evaluate vars using pmap."
17 (let ((syms (mapcar (lambda (x)
18 (gensym (string (car x
))))
21 ,(if (null syms
) `(format nil
"~s" '(progn ,@body
))
22 `(format nil
"(let ~s ~s)"
23 (let ,(loop for
(nil exp
) in bindings
25 collect
`(,sym
(pexec ,exp
)))
26 (list ,@(loop for
(var nil
) in bindings
28 collect
`(list ',var
(yield ,sym
)))))