Next Previous Up Top Contents Index

A.4 Mapping in more detail

A.4.17 Mapping for sequence

An IDL sequence is mapped to a Lisp sequence. Bounds checking shall be done on bounded sequences when they are marshaled as parameters to IDL operations. An implementation is free to specify the type of the mapped list more specifically.

Suppose foo is an IDL data type and let L be the corresponding Lisp type. This means that anywhere a parameter of typesequence<foo> is expected, either a vector (all of whose elements are of type L) or a list (all of whose elements are of type L) may be passed.

Conversely, when such a sequence is returned from an operation invocation, the Harlequin Common Lisp ORB will always return a value of typevector.

For example, in IDL:

module example {
  typedef sequence< long > unbounded_data;
  interface seq{
    boolean param_is_valid(in unbounded_data arg);
  };
}

And in generated Lisp:

(defpackage :example)
(defun unbounded_data_p (sequence)
  (and (typep sequence 'sequence)
       (every #'(lambda(elt)
          (typep elt 'corba:long)))))

(deftype example:unbounded_data() '(satisfies unbounded_data-p))

; Let x be an object of type example:seq (param_is_valid x '(-2 3)) > T

(param_is_valid x #(-200 33)) >T


Developing Component Software with CORBA - 22 Jan 1999

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker