aboutsummaryrefslogtreecommitdiff
path: root/examples/tomodeps
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-16 16:06:19 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-16 16:06:19 -0400
commitde49bc5bb3198f450cb367085f9def0d89782258 (patch)
treea81354271bd3de567a7656807416cd5c69e4b08b /examples/tomodeps
parent821bde156c222c7384c67517d773dc14a03342e7 (diff)
Deprecate :or_else()/:or_fail()/:or_exit() in favor of the `or` operator
Diffstat (limited to 'examples/tomodeps')
-rw-r--r--examples/tomodeps/tomodeps.tm4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/tomodeps/tomodeps.tm b/examples/tomodeps/tomodeps.tm
index b2dc82dc..1cd2ee59 100644
--- a/examples/tomodeps/tomodeps.tm
+++ b/examples/tomodeps/tomodeps.tm
@@ -80,7 +80,7 @@ func _draw_tree(dep:Dependency, dependencies:{Dependency:{Dependency}}, already_
child_prefix := prefix ++ (if is_last: " " else: "│ ")
- children := dependencies:get(dep):or_else({:Dependency})
+ children := dependencies:get(dep) or {:Dependency}
for i,child in children.items:
is_child_last := (i == children.length)
_draw_tree(child, dependencies, already_printed, child_prefix, is_child_last)
@@ -89,7 +89,7 @@ func draw_tree(dep:Dependency, dependencies:{Dependency:{Dependency}}):
printed := {:Dependency}
say(_printable_name(dep))
printed:add(dep)
- deps := dependencies:get(dep):or_else({:Dependency})
+ deps := dependencies:get(dep) or {:Dependency}
for i,child in deps.items:
is_child_last := (i == deps.length)
_draw_tree(child, dependencies, already_printed=&printed, is_last=is_child_last)