Previous Next


;; in an SML process, define a function in a normal way
? (defun calc:add (x y) (+ x y))
;; export it and register on the bus
? (load "smlb")		;load broker
? (smlb:export 'calc:add)		;function is now public
? (smlb:start "Calculator")		;register on the bus

;; now in another SML process
? (load "smlb")	;load broker
;; import function and simply run it
? (smlb:import "Calculator" 'calc:add)
? (calc:add 1 2)	;remote call with automatic connection
 = 3
? (calc:add 1)	;errors are returned as if local
Error: Bad number of arguments: 1
Previous Next