insertAt

abstract fun insertAt(index: Int, argument: Term): Struct

Creates a novel Struct which is a copy of the current one, expect that is has one more argument. The novel argument is inserted into the new Struct's arguments list, at index index, wheres subsequent arguments indexes are shifted by 1.

Return

a new Struct, whose functor is equals to the current one, whose arity is greater than the current one, and whose index-th argument is argument

Parameters

index

is the index the new argument should be inserted into

argument

is a Term of any sort

Throws

if index is lower than 0 or greater or equal to arity