Product SiteDocumentation Site

11.3.6.3.3. Example
This example uses a LinkedList as a queue, adding numbers to the tail, and removing and printing from the head.
(
   var tL = LinkedList.new;

   tL.add( 42 );
   tL.add( 89 );

   tL.popFirst.postln; // prints 42

   tL.add( 256 );

   tL.popFirst.postln; // prints 89

   tL.add( 900 );

   tL.popFirst.postln; // prints 256
   tL.popFirst.postln; // prints 900

   nil;
)