v0.6.34
Breaking changes
Array
has been renamed toList
.
other changes
map
,filter
, ... are nowIterable
methods.
assert [1, 2, 3].map(i -> i + 1).filter(i -> i >= 3).to_list() == [3, 4]
- Now,
hasattr
can narrow types.
C = Class { .foo = Int; .bar = Str }
D = Class { .baz = Str }
bar x: C or D =
if hasattr(x, "foo"):
do: x.bar
do: "?"
assert bar(C.new { .foo = 1; .bar = "bar" }) == "bar"