Now we will implement the client side of the Hello World application. We create a file
hello-world-client.lisp
and add it to the defsystem. (You can implement this as you wish, but here is one possible implementation.)
hello-world-client.lisp
.
hello-world-client.lisp
file:(in-package "CL-USER")
(defun run-client ()
(let ((orb (op:orb_init nil "LispWorks ORB")))
(let ((world (op:narrow 'HelloWorld:world (file-to-object
orb))))
(format t "~S~%" (op:hello world)))))
op:hello
on the object to get a stringThe elided details are not important at this stage, they involve getting an object reference from somewhere. In the full source at the end of this chapter (Complete source code for the Hello World example) you can see that a shared file is used to pass a stringified object reference.
hello-world-client.lisp
file.
hello-world-client
to the defsystem by adding one line of code to the
defsys.lisp
file, which should then look like this:
(in-package "CL-USER")
(require "corba-orb")
(defsystem hello-world-corba-object ()
:members (
("hello-world" :type :idl-file)
"shared"
"hello-world-client"
))
:rules ((:in-order-to :compile "all
(:requires (:load :previous)))))