aboutsummaryrefslogtreecommitdiff
path: root/examples/wrap/wrap.tm
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-11-09 17:26:01 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-11-09 17:26:01 -0500
commit145a078387b8bce5e8e3c93c333c030aa7455e4c (patch)
tree48e113e07888a546bdf9543db2a19587aeef3071 /examples/wrap/wrap.tm
parent8dd51a113ead1fe88c80af9165219ca5398715f6 (diff)
Make the compiler stricter about not promoting local value variables to
pointers
Diffstat (limited to 'examples/wrap/wrap.tm')
-rw-r--r--examples/wrap/wrap.tm6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/wrap/wrap.tm b/examples/wrap/wrap.tm
index 1c43470a..b6cf1403 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,10 +93,10 @@ 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)
)
- out:write(\n\n:join(wrapped_paragraphs) ++ \n)
+ out:write(\n\n:join(wrapped_paragraphs[]) ++ \n)