.nil, item
becomes the first item in the list. If you omit
index, the item becomes the last item in
the list.musketeers=.list~of("Porthos","Athos","Aramis") /* Creates list MUSKETEERS */
/* consisting of: Porthos */
/* Athos */
/* Aramis */
index=musketeers~first /* Gives index of first item */
musketeers~insert("D'Artagnan",index) /* Adds D'Artagnan after Porthos */
/* List is now: Porthos */
/* D'Artagnan */
/* Athos */
/* Aramis */
/* Alternately, you could use */
musketeers~insert("D'Artagnan",.nil) /* Adds D'Artagnan before Porthos */
/* List is now: D'Artagnan */
/* Porthos */
/* Athos */
/* Aramis */
/* Alternately, you could use */
musketeers~insert("D'Artagnan") /* Adds D'Artagnan after Aramis */
/* List is now: Porthos */
/* Athos */
/* Aramis */
/* D'Artagnan */