List

List – list data type
list – list creation

Calling sequence

L = list()   // or L = list_create()  
L = list(O1, O2, O3, ...)  // or L = list_create(O1, O2, O3, ...)

Parameters

Description
The List data type is useful to collect objects of different types. Internally nsp lists are implemented as doubled linked lists and operations (extraction, insertion, deletion) on head and queue are efficient. The list (or list_create) function can be used to create lists.

Operations on lists

methods

extraction, insertion, deletion

Note that some of these features are useful for scilab compatibility but we recommend for speed efficiency to use methods when possible. In particular, L.remove[i] should be preferred to L(i)=null() (resp. L.remove_first[] and L.remove_last[] to delete head and queue elements), Use L.add_first[e] instead of L(0)=e, and L.add_last[e] instead of L($+1) = e.

For loop control using a list
With a list L:

     for e=L  
       ....  
     end

is a loop with length(L) iterations, the loop variable e being equal to L(i) at the i-th iteration.

Some functions

Examples

See also unique (??) setdiff (??)

Authors jpc, bp