From c48a992a6ed6ebd79c344b37364a680ddd948dea Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Sat, 31 Aug 2024 13:08:56 -0700 Subject: Combine structs and expressions --- tests/24-functor.sml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/24-functor.sml (limited to 'tests/24-functor.sml') diff --git a/tests/24-functor.sml b/tests/24-functor.sml new file mode 100644 index 0000000..d18337e --- /dev/null +++ b/tests/24-functor.sml @@ -0,0 +1,17 @@ +signature MagicNumber = sig + val n : int +end + +functor Exiter(N : MagicNumber) = struct + fun exit _ = __builtin "exit" N.n +end + +structure FourtyTwo = struct + val a = 16 + val n = 42 + val z = 38 +end + +structure FourtyTwoExiter = Exiter(FourtyTwo) + +val _ = FourtyTwoExiter.exit () -- cgit v1.3.1