77->List 1[5]
Fortunately, there are ways to get around all of these problems, to greatly increase the power of lists as programming tools.
Trn Augment(List->Mat(List 1),[[77->Mat A Mat->List(Mat A,1
This has the disadvantage that it requires a spare matrix, taking up more memory than necessary. Because of this, you may prefer instead to use the following method:
To append 77 to List 1 (sequence method):
1+Dim List 1 Seq(77Int X%Ans + (X<>Ans)List 1[X - (X=Ans, X, 1, Ans, 1->List 1
This has a speed disadvantage when compared to the matrix method however.
To concatenate List 1 and List 2 and store the result in List 3 (matrix method):
Trn Augment(Trn List->Mat(List 1),Trn List->Mat(List 2)->Mat A Mat->List(Mat A,1->List 3
To concatenate List 1 and List 2 and store the result in List 3 (sequence method):
Dim List 1 Seq(List 2[X - Ans + (X<=Ans)(1 - X + Ans](X>Ans) + (X<=Ans)List 1 [X - (X>Ans)(X - 1, X, 1, Ans + Dim List 2, 1->List 3
Seq(77(X=5)+(X<>5)List 1[X - (X > 5, X, 1, Dim List 1 + 1, 1->List 1
Seq(List 1[X+(X>=5, X, 1, Dim List 1 - 1, 1->List 1
Note that you can't delete the first item in a list if it is the only item in the list. I must admit that at the moment I can't remember/think how to do that, as I think ClrList clears all lists and { } -> List 1 gives a syntax error. It could be the one thing you can't do with lists... If it is, you might have to keep a dummy value in the first item.
To delete the last item in a list:
Seq(List 1[X, X, 1, Dim List 1 - 1, 1->List 1