]> gitweb.factorcode.org Git - factor.git/commitdiff
help.tour: use index-or-length
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 16 Jan 2023 20:41:30 +0000 (12:41 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 16 Jan 2023 20:41:30 +0000 (12:41 -0800)
basis/help/tour/tour.factor

index a10d91eae7b97db86e0cb0e5f8050522bb2251c2..b6ec0b6ddf433527bbae1454e6c3d6fc7b127429 100644 (file)
@@ -935,7 +935,7 @@ This is an impractical example of exceptions, as Factor defines the { $link shor
 sequence and a number, and returns the minimum between the length of the sequence and the number. This allows us to write simply
 
 { $code "
-: safe-head ( seq n -- seq' ) short head ;" }
+: safe-head ( seq n -- seq' ) index-or-length head ;" }
 With this definition, we can make a word to read the first character of the first line:
 
 { $code "