discord test stars


Various common data structures in the Mys programming language.

Project: https://github.com/mys-lang/package-collections


class FifoError(Error):
    message: string
class Fifo:
    A fixed size fifo.

    func __init__(self, capacity: i64):

    func length(self) -> i64:
        Returns the number of items in the fifo.

    func is_full(self) -> bool:
        Returns True if the fifo is full, False otherwise.

    func is_empty(self) -> bool:
        Returns True if the fifo is empty, False otherwise.

    func push(self, item: T):
        Push an item on the fifo.

    func pop(self) -> T:
        Pop an item from the fifo.