The only portable way to implement an operation on a servant class is to use thecorba:define-method macro. The syntax ofcorba:define-method is intended to follow the syntax of the Lispdefmethod macro as closely as possible.
The syntax ofcorba:define-method is as follows:
corba:define-method function-name {method-qualifier}* lambda-list
form*
function-name::= {operation-name | (setf operation-name)}
operation-name:: symbol
method-qualifier::={:before | :after | :around}
corba-specialized-lambda-list ::= setf-lambda-list
| normal-lambda-list
setf-lambda-list ::= (argument-specifier receiver-specifier)
normal-lambda-list ::= (receiver-specifier {parameter-specifer}* context-identifier)
context-identifier ::= symbol
receiver-specifer ::= (receiver-name receiver-class)
receiver-name ::= symbol
receiver-class ::= symbol
parameter-specifier ::= symbol
Thiscorba:define-method macro is used to implement an operation on an interface.operation-name is a symbol whose name is the name either of an operation or of an attribute declared in an IDL interface implemented by the class named by the symbolreceiver-class.
The number ofparameter-specifiers listed in thenormal-lambda-list must equal the combined number ofin andinout parameters declared in the signature of the operation denoted by thefunction-name, or0 if the operation is an attribute. If thefunction-name is a list whosecar issetf, the correspondingoperation-name should name an attribute that is not readonly.
If function-name denotes an operation, then the effect ofcorba:define-method is to inform the ORB that requests for the operation on instances of the classreceiver-class should return the value or values returned by the body forms of thedefine-method macro, executed in a new lexical environment in which eachparameter-specifier is bound to the actual parameters and in which thecontext-identifer is bound to the value of the corresponding context.
The operation ofcorba:define-method in the case in whichfunction-name names an attribute is analogous. The behavior of auxiliary specifiers and of dispatch is the same as their corresponding action under defmethod. Attribute accessors will be generated automatically and inherited by subclasses of the servant classes; the methods can be overridden by user definitions.
Note that the syntax ofcorba:define-method is a strict subset of that ofdefmethod: every legalcorba:define-method invocation is also a legaldefmethod invocation. The main difference between them is thatcorba:define-method only allows specialization on the first argument. An implementation is free to extend the syntax ofcorba:define-method, for example, to allow type-checking, interlocking, or multiple dispatch.
Generated with Harlequin WebMaker