Paste: two-or-less
Author: | mrjbq7 |
Mode: | factor |
Date: | Thu, 25 Apr 2013 20:50:18 |
Plain Text |
: two-or-less ( seq -- seq' )
dup dup '[
dup 2 < [ 2drop t ] [
[ 1 - _ nth = ] [ 2 - _ nth = ] 2bi and not
] if
] filter-index ;
IN: scratchpad "abcccccccdeefgg" two-or-less .
"abccdeefgg"
Author: | mrjbq7 |
Mode: | factor |
Date: | Thu, 25 Apr 2013 20:57:15 |
Plain Text |
: two-or-less-newlines ( seq -- seq' )
dup dup '[
2dup [ CHAR: \n = ] [ 1 > ] bi* and [
[ 1 - _ nth = ] [ 2 - _ nth = ] 2bi and not
] [ 2drop t ] if
] filter-index ;
New Annotation