From 4117430762c10ffcb8246a7ac3b40c79f41cc876 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 9 Feb 2009 00:25:46 -0600 Subject: [PATCH] string-lines throws an error if input is not a string --- core/splitting/splitting.factor | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/splitting/splitting.factor b/core/splitting/splitting.factor index 50ddab4da5..6d833c792e 100644 --- a/core/splitting/splitting.factor +++ b/core/splitting/splitting.factor @@ -63,7 +63,9 @@ PRIVATE> : split ( seq separators -- pieces ) [ split, ] { } make ; -: string-lines ( str -- seq ) +GENERIC: string-lines ( str -- seq ) + +M: string string-lines dup "\r\n" intersects? [ "\n" split [ but-last-slice [