3.3.4 Using collections

The macro do-collection-items can be used to iterate over the items or an interface that implements the Collection protocol. If the collection items are interface pointers, they must be released when not needed.

For example, to iterate over the Table objects from the Tables collection of a MyDocument interface pointer

(with-temp-interface (tables)
       (doc my-document tables))
  (do-collection-items (table tables)
    (inspect-the-table table)
    (release table)))

LispWorks COM/Automation User Guide and Reference Manual - 17 Jul 2006