import klyn.collections

class Product:
    public readonly property name as String
    public readonly property price as Double

    public Product(name as String, price as Double):
        this.name = name
        this.price = price

    public discounted(rate as Double = 0.10) as Double:
        return this.price * (1.0 - rate)

catalog as List<Product> = [
    Product("Keyboard", 89.0),
    Product("SSD 1 TB", 129.0),
    Product("SSD 2 TB", 199.0)
]

selection = [p for p in catalog if p.name =~ /^SSD.*/]

for product in selection:
    print(f"{product.name}: {product.discounted():.2f} EUR")
