Pliant release 41 introduces a consistent set of generic data types for storing data sets.
Type
List values_type In a list, the elements have no key. So, you can access them only through walking the list.
Array values_type Keys are integers, and the valid keys set is ranging from 0 to the size of the array minus one. You can have a single value associated with each key.
Dictionary keys_type values_type Each key value is free. You can have several values associated with the same key. When you walk the dictionary, you get the keys values pairs in a random order.
Index keys_type values_type Each key value is free. You can have several values associated with the same key. W When you walk the index, you get the key values pairs in ascending keys order.
The following properties list should help you select the right data set type for your application:
Type Walking Bidirectionnal walking Direct access Insert/Remove
List very fast yes no fast
Array very fast no (would be very fast if implemented) very fast slow
Dictionary quite fast no (would be quite fast if implemented) quite fast quite fast most time
Index very fast yes medium medium
These are the methods available:

method s first -> v
  arg Set s ; arg_C Value v

Returns a pointer to the first value in the data set.
If the data set is empty, the pointer will be null.
List Array Dictionary Index
yes yes yes yes

method s next v1 -> v2
  arg Set s ; arg_r Value v1 ; arg_C Value v

Returns a pointer to the next value in the data set.
If no more value is available, the pointer will be null.
List Array Dictionary Index
yes yes yes yes

method s last -> v
  arg Set s ; arg_C Value v

List Array Dictionary Index
yes no no yes

method s previous v1 -> v2
  arg Set s ; arg_r Value v1 ; arg_C Value v

List Array Dictionary Index
yes no no yes

method s from k -> v
  arg Set s ; arg Key k ; arg_C Value v

Returns a pointer to the first value which key is greater or equal to k.
List Array Dictionary Index
no no no yes

method s to k -> v
  arg Set s ; arg Key k ; arg_C Value v

Returns a pointer to the first value which key is greater than k.
List Array Dictionary Index
no no no yes

method s key v -> k
  arg Set s ; arg_r Value v ; arg_R Key k

Returns a pointer to the key associated with the value pointed by 'v'.
List Array Dictionary Index
no yes yes yes


method s first k -> v
  arg Set s ; arg Key k ; arg_C Value v

Returns a pointer to the first value in the data set associated with the specifyed key.
If the data set is empty, the pointer will be null.
List Array Dictionary Index
no yes yes yes

method s next k -> v
  arg Set s ; arg Key k ; arg_C Value v

Returns a pointer to the next value in the data set associated with the specifyed key.
If there are no more values, the pointer will be null.
List Array Dictionary Index
no yes yes yes

method s exists k -> c
  arg Set s ; arg Key k ; arg CBool c

Tests if at least one element with the specifyed key is available in the data set.
This is equivalent to addressof:(s first k)<>null
List Array Dictionary Index
no yes yes yes

method s '' k -> v
  arg Set s ; arg Key k ; arg_C Value v

Returns a pointer to the first value in the data set associated with the specifyed key.
There must be such a value, or a fatal error will be raised.
List Array Dictionary Index
no yes yes yes


function '+=' s v
  arg_rw Set s ; arg Value v

Adds a new value to the set.
List Array Dictionary Index
yes slow no no

method s insert k v -> v2
  arg Set s ; arg Key k ; arg  Value v ; arg_C Value v2

List Array Dictionary Index
no no yes yes

method s insert_before v1 v -> v2
  arg Set s ; arg_r Value v1 ; arg Value v ; arg_C Value v2

List Array Dictionary Index
yes no no no

method s insert_after v1 v -> v2
  arg Set s ; arg_r Value v1 ; arg Value v ; arg_C Value v2

List Array Dictionary Index
yes no no no

function '-=' s v
  arg_rw Set s ; arg_r Value v

Removes the element pointed by v.
List Array Dictionary Index
yes no yes yes

method s remove v -> v2
  arg_rw Set s ; arg_r Value v ; arg_C Value v2

List Array Dictionary Index
no no yes yes

method s size -> n
  arg Set s ; arg Int n

Returns the number of elements in the data set.
List Array Dictionary Index
slow yes yes yes

s size := n

Sets the number of elements in the data set.
List Array Dictionary Index
no yes no no