From 7e8604daeb9239e1669c5414dd6caa37af30c4ff Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 11 Oct 2025 15:31:38 -0400 Subject: Make `{a,b,c}` shorthand for `{a:Empty(), b:Empty(), c:Empty()}` and display it that way. Same for type annotations. --- test/tables.tm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/tables.tm b/test/tables.tm index 2eb1409e..68b77baf 100644 --- a/test/tables.tm +++ b/test/tables.tm @@ -87,3 +87,13 @@ func main() assert a.intersection(b) == {"B":2} assert a.difference(b) == {"A":1, "D":40} assert a.without(b) == {"A":1, "C":3} + + do + # Set operations with sets + a := {"A", "B", "C"} + b := {"B", "C", "D"} + assert a.with(b) == {"A", "B", "C", "D"} + assert a.with(b) == a ++ b + assert a.intersection(b) == {"B", "C"} + assert a.difference(b) == {"A", "D"} + assert a.without(b) == {"A"} -- cgit v1.2.3