Question: how to keep set members in order of addition

i have a question about sets. how can i keep set members in order of addition not the defualt maple ordering.
in maple help, i saw the command setsort=0..8 but i do not know how to use it.
consider exmaple below:


 

restart

L:={}:

for j in [3,5,6,1] do
birth:=j:
L:=`union`(L ,{j});
od;

3

 

{3}

 

5

 

{3, 5}

 

6

 

{3, 5, 6}

 

1

 

{1, 3, 5, 6}

(1)

 


how can i keep L as order of addition? L={3,5,6,1}. thanks in advance

Download setoder.mw

Please Wait...