From 1d2e55f53dfab5153dbfd0c03f28cd9daedb3b77 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 6 Apr 2025 19:20:07 -0400 Subject: Allow uninitialized variables when there's a sensible empty value (defaults to empty/zero value) --- examples/wrap/wrap.tm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/wrap') diff --git a/examples/wrap/wrap.tm b/examples/wrap/wrap.tm index 303393ee..1a29701f 100644 --- a/examples/wrap/wrap.tm +++ b/examples/wrap/wrap.tm @@ -33,7 +33,7 @@ func wrap(text:Text, width:Int, min_split=3, hyphen="-" -> Text) ... and I can't split it without splitting into chunks smaller than $min_split. ") - lines : @[Text] = @[] + lines : @[Text] line := "" for word in text.split($/{whitespace}/) letters := word.split() @@ -93,7 +93,7 @@ func main(files:[Path], width=80, inplace=no, min_split=3, rewrap=yes, hyphen=UN (/dev/stdout) first := yes - wrapped_paragraphs : @[Text] = @[] + wrapped_paragraphs : @[Text] for paragraph in text.split($/{2+ nl}/) wrapped_paragraphs.insert( wrap(paragraph, width=width, min_split=min_split, hyphen=hyphen) -- cgit v1.2.3