/// A generic stack for equatable items. public struct Stack: Equatable where T: Equatable { private(set) var items: [T] public init(items: [T] = []) { self.items = items } public mutating func push(item: T) { items.append(item) } /* /* ... */ */ fileprivate var description: String { if items.isEmpty { "The stack is empty" } else { "\(items.count) items in the stack" } } }