Paste: .cut - print lines to avoid sidescrolling
Author: | rien |
Mode: | factor |
Date: | Tue, 11 Oct 2011 06:51:44 |
Plain Text |
: (.cut) ( vec str n -- vec str n )
2dup swap length <
[ [ cut ] keep
[ [| v x xs | x v push v xs ] call ] dip (.cut) ] [ ] if ;
: .cut ( str n -- )
0 <vector> -rot (.cut) drop swap [ push ] keep [ . ] each ;
"this is a very long string and it's highly annoying to read a long string by having to scroll sideways. " dup [ append ] curry 2 swap times 60 .cut
"this is a very long string and it's highly annoying to read "
"a long string by having to scroll sideways. this is a very l"
"ong string and it's highly annoying to read a long string by"
" having to scroll sideways. this is a very long string and i"
"t's highly annoying to read a long string by having to scrol"
"l sideways. "
Author: | Jon |
Mode: | factor |
Date: | Wed, 12 Oct 2011 12:12:38 |
Plain Text |
USE: grouping
: .cut ( str n -- ) group [ . ] each ;
Author: | rien |
Mode: | factor |
Date: | Sun, 16 Oct 2011 04:44:41 |
Plain Text |
USE: grouping
: .cut ( str n -- ) <groups> [ . ] each ;
New Annotation