Module DescriptionThe scl module implements a single linked list that can store cell wide data. Module WordsList structurescl% ( -- n ) Get the required space for a scl variable
List creation, initialisation and destructionscl-init ( scl -- ) Initialise the scl list
scl-(free) ( scl -- ) Free the nodes from the heap
scl-create ( "<spaces>name" -- ; -- scl ) Create a named scl list in the dictionary
scl-new ( -- scl ) Create a new scl list on the heap
scl-free ( scl -- ) Free the list from the heap
Member wordsscl-empty? ( scl -- flag ) Check for an empty list
scl-length@ ( scl -- u ) Get the number of nodes in the list
scl-compare! ( xt scl -- ) Set the compare execution token for sorting the list
scl-compare@ ( scl -- xt ) Get the compare execution token for sorting the list
List wordsscl-clear ( scl -- ) Delete all nodes from the list
scl-append ( x scl -- ) Append the cell data x in the list
scl-prepend ( x scl -- ) Prepend the cell data x in the list
Index wordsscl-index? ( n scl -- flag ) Check if the index n is valid for the list
scl-set ( x n scl -- ) Set the cell data x in the nth node in the list
scl-get ( n scl -- x ) Get the cell data x from the nth node in the list
scl-insert ( x n scl -- ) Insert cell data x at the nth node in the list
scl-delete ( n scl -- x ) Delete the nth node from the list, return the cell data from the deleted node
Special wordsscl-count ( x scl -- u ) Count the number of occurences of the cell data x in the list
scl-execute ( i*x xt scl -- j*x ) Execute xt for every cell data in list
scl-reverse ( scl -- ) Reverse or mirror the list
Search wordsscl-find ( x scl -- n ) Find the first index for cell data x in the list, -1 for not found
scl-has? ( x scl -- flag ) Check if the cell data x is present in the list
scl-remove ( x scl -- flag ) Remove the first occurrence of the cell data x from the list, return success
Sort wordsscl-insert-sorted ( x scl -- ) Insert the cell data x sorted in the list
Inspectionscl-dump ( scl -- ) Dump the list
Generated by ofcfrth-0.10.0
|