aboutsummaryrefslogtreecommitdiff
path: root/examples/wrap
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-04 17:06:09 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-04 17:06:09 -0400
commit0b8074154e2671691050bdb3bcb33245625a056c (patch)
tree1410e0c4e05c6372e876cd08f16d117e12868f41 /examples/wrap
parentfadcb45baf1274e06cfe37b87655b9146aa52874 (diff)
First working compile of refactor to add explicit typing to declarations
and support untyped empty collections and `none`s
Diffstat (limited to 'examples/wrap')
-rw-r--r--examples/wrap/wrap.tm4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/wrap/wrap.tm b/examples/wrap/wrap.tm
index c90713a9..61ca5821 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)