func vers: List(Int), version: Int = all map(v -> v == version, vers) assert func([1, 1], 1) func2! version: Int = arr = ![] f!() = arr.push! version f!() arr arr = func2!(1) assert arr[0] == 1 for! [1], _ => result = !"" push! left, right = result.push! "| \{left} | \{right} |\n" push! "a", "b" assert result == "| a | b |\n" {SemVer;} = import "semver" Versions! = Class Dict! { Str: List!(SemVer) } Versions!. new() = Versions! !{:} insert!(ref! self, name: Str, version: SemVer) = if! self::base.get(name) == None: do!: self::base.insert! name, ![version] do!: if! all(map(v -> v != version, self::base[name])), do!: self::base[name].push! version vs = Versions!.new() _ = vs.insert! "foo", SemVer.from_str "1.0.0" _ = vs.insert! "foo", SemVer.from_str "1.0.1" Triple = Class { .version = SemVer; } Triple. new version = Triple { .version; } .Version! = Class Dict! { Str: List!(Triple) } .Version!. new!() = .Version! !{ "a" : ![Triple.new(SemVer.from_str("0.1.0"))] } insert!(ref! self, name: Str, version: SemVer) = if! all(map((triple) -> not(triple.version.compatible_with(version)), self::base[name])), do!: self::base[name].push!(Triple.new(version)) f!() = vers = .Version!.new!() vers.insert!("a", SemVer.from_str("0.2.0")) f!()