>>-insert(item-+--------+-)------------------------------------>< +-,index-+
Example 5.170. Queue class - insert method
musketeers=.queue~of("Porthos","Athos","Aramis) /* Creates queue 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 */