The subseq Module ================= .. current-library:: collection-extensions .. current-module:: subseq Overview -------- :class:`` is a new subclass of :drm:``. A subsequence represents an aliased reference to some part of an existing sequence. Although they may be created by :drm:`make` (with required keywords ``source:``, ``start:`` and ``end:``) on one of the instantiable subclasses, they are more often created by calls of the form .. code-block:: dylan subsequence(sequence, start: 0, end: 3) where ``start:`` and ``end:`` are optional keywords which default to the beginning and end, respectively, of the source sequence. No other new operations are defined for subsequences, since all necessary operations are inherited from :drm:``. Because subsequences are aliased references into other sequences, several properties must be remembered: 1. The contents of a subsequence are undefined after any destructive operation upon the source sequence. 2. Destructive operations upon subsequences may be reflected in the source. The results of reverse! and sort! should be expected to affect the source sequence for vector subsequences. If the source sequences are instances of :drm:`` or :drm:``, then the implementation will use subclasses of :class:`` which are also subclasses of :drm:`` or :drm:``. Efficiency notes: 1. The implementation tries to insure that subsequences of subsequences can be accessed as efficiently as the original subsequence. (For example, the result of .. code-block:: dylan subsequence(subsequence(source, start: 1), start: 2) would produce a subsequence identical to the one produced by .. code-block:: dylan subsequence(source, start: 3) 2. Vector subsequences, like all other vectors, implement constant time element access. 3. Non-vector subsequences may take non-constant time to create, but will provide constant-time access to the first element. This should produce the best performance provided some element of the subsequence is accessed at least once. Reference --------- .. class:: :superclasses: :class:`` .. class:: :abstract: :superclasses: :drm:`` :keyword required end: An instance of :drm:``. :keyword required source: An instance of :drm:``. :keyword required start: An instance of :drm:``. .. generic-function:: subsequence :signature: subsequence (seq) => (#rest results) :parameter seq: An instance of :drm:``. :value #rest results: An instance of :drm:``. .. method:: subsequence :specializer: .. method:: subsequence :specializer: .. method:: subsequence :specializer: .. method:: subsequence :specializer: .. method:: subsequence :specializer: .. method:: subsequence :specializer: .. method:: subsequence :specializer: