Structures and sequences offer similar functionality to items and lists, respectively. However, for performance reasons, you should not use them interchangeably.
conclude action to access user-defined attributes
Comparison Between Sequences and Lists
The properties of sequences and lists are:
Guidelines for Creating Composite Data Structures
In addition to using sequences and structures to access system-defined attributes, you can also use sequences and structures to create your own composite data structures. Follow these guidelines for deciding when to use sequences and structures. Use Structures to Create Items with Dynamic, Nested Attribute Values
Use structures when you need to:
The exception to this recommendation is when you are inserting a sequence at the end of the same sequence, which is a constant time operation. Thus, if this is the only type of manipulation you are doing, you can use a sequence; otherwise, use a list.
History-keeping-spec attribute of a variable:
![]() |
You can declare data types, using
structure in the same contexts that you declare any data type:
To create or access a value of type structure:
Use the structure function, followed by any number of name-value pairs of any type, including other structures or sequences.
the identity of x
for symbol = each symbol that is an attribute name of x do...
change-attribute ( ).
remove-attribute ( ).
Item-configuration attribute value:
![]() |
You can declare data types, using
sequence in the same contexts that you declare any data type:
To create or access a value of type sequence:
Use the sequence function, followed by any number of items or values, including other structures or sequences.
insert-at-beginning and insert-at-end
insert-after function.
insert-before-element and insert-after-element
S = insert-at-end(S, element). The performance of the other operations depends on the number of elements in the sequence.