5.1.1 Functions

5.1.2 Generic functions

Generic Function: add-segmentPIPELINE SEGMENT &optional PLACE

Add a new segment to the pipeline.
If place is set, the pipe is added to the specified place as per INSERT.
The place specified is expected to be a splitter or similar to append
the pipe to. Returns the segment.

Searches and returns the segment as designated by PLACE.
A place is a list of signed integers, each denoting the position of the item
within the current splitter or segment. Subsequent numbers descend into the
item matched by the previous number.

Appends the item to the given place unless a specific position is given.
If position is set, the item is expected to be inserted at the specified position, without
replacing or disturbing any other items.

Returns the segment.

Do note that using insert directly can affect names and make them invalid or point to unexpected
segments. You should always use add-segment or insert-segment instead if possible.

Note for implementors of this method for custom segments:
You are expected to return a message object, which will be
used for subsequent passing down the current segment. If you
return NIL, passing stops. This does not affect passing in
segments on other splitters. Do note that changing the object
itself directly will of course als be reflected at any other
point in the pipeline passing, so muting the passed object
should be avoided wherever possible.

Removes an item from the place, by default from the end unless position is set.
If position is given, it is expected that the specified item is removed without disturbing any
other items and without leaving any empty spaces within the parent.

Returns the segment.

Do note that using withdraw directly can affect names and make them invalid or point to unexpected
segments. You should always use remove-segment instead if possible.

5.2 Internal definitions

5.2.1 Functions

Helper function that shifts a subset of array elements in either direction for a specified amount.
Optionally also extends the array and fills empty space with a given element.

N — The amount to be moved. Can either be positive or negative.
FROM — Move region start point.
TO — Move region end point.
ADJUST — Whether to adjust the fill pointer and the array bounds.
FILL — If provided, empty spaces created by the move will be filled with this element.

Pushes the element into the specified position and shifts everything
to the right to make space. This is potentially very costly as all
elements after the given position need to be shifted as per ARRAY-SHIFT.