Adds the supplied item to the end of the supplied list. The supplied list must be modifiable.
:-) var list = newList( "a", "b" );
:-) list;
There is 1 result
[a, b]
:-) list.addLast( "c" );
There are 0 results
:-) list;
There is 1 result
[a, b, c]
If you try to update a unmodifiable list, you will get a mishap, e.g.
:-) { "a", "b" }.addLast( "c" );
MISHAP : Trying to add an item to an immutable list
BECAUSE : Immutable lists cannot be altered
ITEM : c
LIST : [a, b]
DOING : <function addLast>
LINE NO. : 4
PHASE : Evaluation
Trapped : org.millscript.millscript.Alert$EscapeException
Resetting input and resuming execution