Error, assigning to a long list, please use Arrays - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : System : Error Message Guide : assigningtolonglistpleaseuseArrays

Error, assigning to a long list, please use Arrays

Description

Lists in Maple are immutable, that is, with l[1] := 2 you create a copy of l and change the first element of this second list. You now have two lists in memory. Repeating this many times produces a different copy of the list each time; as a result, this error may occur because copying the entire list requires a significant amount of memory.

 

Arrays, on the other hand, can be modified in place and therefore use less memory. For example, by reassigning A[1], you do not allocate new memory.

Examples

lseqi,i=1..200:l12;

Error, assigning to a long list, please use Arrays

Solution: use Arrays

l  Arrayseqi,i=1..200:l1  2;

l1:=2

(2.1)

l

1 .. 200 ArrayData Type: anythingStorage: rectangularOrder: Fortran_order

(2.2)

See Also

Arrays, efficiency


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam