From 396ebf0c76153e5e1e9dc77371bdd02b4d3d85d1 Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Mon, 4 Aug 2025 15:12:55 +0200 Subject: Flattening of initializers --- common.sml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common.sml') diff --git a/common.sml b/common.sml index 4bde818..72efe93 100644 --- a/common.sml +++ b/common.sml @@ -169,14 +169,14 @@ fun poptN z = poptInternal false z val Popt = fn z => bind A2 (poptInternal false "") z val PoptS = fn z => bind A2 (poptInternal true "") z -fun plist p l (s, parens) out = +fun plist p l (s, parens, from) out = let fun f [] _ = () | f [e] out = Printf out A1 p e % | f (e1 :: e2 :: tail) out = (Printf out A1 p e1 %; Printf out `s A1 f (e2 :: tail) %) in - if parens andalso length l > 1 then + if parens andalso length l >= from then Printf out `"(" A1 f l `")" % else Printf out A1 f l % -- cgit v1.2.3