Next: Graph Objects Up: Basic Objects Previous: Typed Vectors

## Typed Lists

Generally, algorithms which return collections of data will use objects from the Collection hierarchy. However, it is possible for algorithms to return List<type> objects, and the latter can be manipulated in a limited way in Scheme. The only necessary manipulations are simply translations to and from standard Scheme lists.

Figure 8.14: Comparison of typed vectors
| (list->list-type list )

Given a Scheme list containing the elements of type type, create and return a C++ list containing those elements. O(n)

| (list-type ->list type-list )

Create a Scheme list containing the elements of type-list. O(n)

| (list-int? list )

Return #t if list is a C++ list of `int` objects. O(1)