From 487926f77968a64bddf3614313ccd7fbca1a0483 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 23 Oct 2005 22:33:40 +0000 Subject: [PATCH] add max-length word --- library/collections/sequence-combinators.factor | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/collections/sequence-combinators.factor b/library/collections/sequence-combinators.factor index ef81823481..2d671047a0 100644 --- a/library/collections/sequence-combinators.factor +++ b/library/collections/sequence-combinators.factor @@ -69,6 +69,9 @@ M: object map ( seq quot -- seq ) : min-length ( seq seq -- n ) [ length ] 2apply min ; flushable +: max-length ( seq seq -- n ) + [ length ] 2apply max ; flushable + : 2each ( seq seq quot -- ) #! Don't use with lists. -rot 2dup min-length [ (2each) ] repeat 3drop ; inline