From fbc6ed834d08b3f97bfcc86b0435cb31da56f4ab Mon Sep 17 00:00:00 2001 From: andrew-johnson-4 Date: Wed, 22 Jan 2025 17:50:54 -0700 Subject: [PATCH] arity sensitive! --- Cargo.toml | 2 +- Makefile | 2 +- PLATFORM/C/LIB/tuple.lsts | 5 +++++ tests/regress/3tuple.lsts | 7 +++++++ tests/regress/3tuple.lsts.out | 1 + 5 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 tests/regress/3tuple.lsts create mode 100644 tests/regress/3tuple.lsts.out diff --git a/Cargo.toml b/Cargo.toml index 5cece82f..a8ed774b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lambda_mountain" -version = "1.20.38" +version = "1.20.39" authors = ["Andrew "] license = "MIT" description = "Typed Macro Assembler (backed by Coq proofs-of-correctness)" diff --git a/Makefile b/Makefile index 2a752b8a..96e9488e 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ dev: install-production - lm tests/unit/type-inference.lsts + lm tests/regress/3tuple.lsts cc -O3 tmp.c ./a.out diff --git a/PLATFORM/C/LIB/tuple.lsts b/PLATFORM/C/LIB/tuple.lsts index 2bef4d80..181824b2 100644 --- a/PLATFORM/C/LIB/tuple.lsts +++ b/PLATFORM/C/LIB/tuple.lsts @@ -1,5 +1,6 @@ type Tuple = Tuple { first: x, second: y }; +type Tuple = Tuple { first: x, second: y, third: z }; let cmp(l: Tuple, r: Tuple): Ord = ( cmp(l.first, r.first) && cmp(l.second, r.second) @@ -13,6 +14,10 @@ let print(io: IO::File, l: Tuple): Nil = ( print(io, "("); print(io, l.first); print(io, ","); print(io, l.second); print(io, ")"); ); +let print(io: IO::File, l: Tuple): Nil = ( + print(io, "("); print(io, l.first); print(io, ","); print(io, l.second); print(io, ","); print(io, l.third); print(io, ")"); +); + let $"=="(l: Tuple, r: Tuple): U64 = ( l.first == r.first && l.second == r.second ); diff --git a/tests/regress/3tuple.lsts b/tests/regress/3tuple.lsts new file mode 100644 index 00000000..b0a0f532 --- /dev/null +++ b/tests/regress/3tuple.lsts @@ -0,0 +1,7 @@ + +import LIB/default.lm; + +let t2 = Tuple{ 1, 2 }; +print(t2); +let t3 = Tuple{ 1, 2, 3 }; +print(t3); diff --git a/tests/regress/3tuple.lsts.out b/tests/regress/3tuple.lsts.out new file mode 100644 index 00000000..410e3211 --- /dev/null +++ b/tests/regress/3tuple.lsts.out @@ -0,0 +1 @@ +(1,2)(1,2,3)