Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,24 @@
import system'collections;
import extensions;
public program()
{
// Create a queue and "push" items into it
var queue := new Queue();
queue.push:1;
queue.push:3;
queue.push:5;
// "Pop" items from the queue in FIFO order
console.printLine(queue.pop()); // 1
console.printLine(queue.pop()); // 3
console.printLine(queue.pop()); // 5
// To tell if the queue is empty, we check the count
console.printLine("queue is ",(queue.Length == 0).iif("empty","nonempty"));
// If we try to pop from an empty queue, an exception
// is thrown.
queue.pop() | on:(e){ console.writeLine:"Queue empty." }
}