From 290c72732f21f1cddb3a0f8ec3213e4ec321da14 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 15 Nov 2025 18:13:44 -0500 Subject: Add Path.lines() --- man/man3/tomo-Path.by_line.3 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'man') diff --git a/man/man3/tomo-Path.by_line.3 b/man/man3/tomo-Path.by_line.3 index ff7a737c..02a75c5a 100644 --- a/man/man3/tomo-Path.by_line.3 +++ b/man/man3/tomo-Path.by_line.3 @@ -2,7 +2,7 @@ .\" Copyright (c) 2025 Bruce Hill .\" All rights reserved. .\" -.TH Path.by_line 3 2025-05-17 "Tomo man-pages" +.TH Path.by_line 3 2025-11-15 "Tomo man-pages" .SH NAME Path.by_line \- iterate by line .SH LIBRARY @@ -31,12 +31,12 @@ An iterator that can be used to get lines from a file one at a time or none if t .EX # Safely handle file not being readable: if lines := (./file.txt).by_line() -for line in lines -say(line.upper()) + for line in lines + say(line.upper()) else -say("Couldn't read file!") + say("Couldn't read file!") # Assume the file is readable and error if that's not the case: for line in (/dev/stdin).by_line()! -say(line.upper()) + say(line.upper()) .EE -- cgit v1.2.3