VocabularysequencesInputsn | a non-negative integer |
seq | a resizable sequence |
OutputsNone
Generic word contractEnsures the sequence has a length of at least
n elements. This word differs from
set-length in two respects:
• | This word does not shrink the sequence if n is less than its length. |
• | The word doubles the underlying storage of seq, whereas set-length is permitted to set it to equal n. This ensures that repeated calls to this word with constant increments of n do not result in a quadratic amount of copying, so that for example push-all can run efficiently when used in a loop. |
DefinitionMethods