binsert
binsert — inserts a value into a buffer.
binsert (buffer, position, value)
bufferA buffer.
positionA number giving the zero-based position of the new element within the buffer, or a function.
valueA number which will be cast to an 8-bit signed integer.
The value inserted.
The binsert function inserts the value by moving
all other values after position one space to the
right, and removing the last value from the buffer.
If position is a function, it is taken to be a
comparison function with two arguments. The value will be inserted using a
binary insertion sort with the function as the comparison. A comparison
function must return a negative number if the value is ordinally less than
the buffer element, 0 if the two are equal, and a positive number if the
value is ordinally greater than the buffer element.
Gamma>x = string_to_buffer("Hellothere");#{Hellothere}Gamma>binsert(x,5,32);32Gamma>x;#{Hello ther}Gamma>