From 5a1ab1edaed1e93b9d6f436970772579c90c8b22 Mon Sep 17 00:00:00 2001 From: Alfredo Beaumont Date: Fri, 11 Jul 2008 16:16:01 +0200 Subject: [PATCH] Some improvements both in elegance and performance in ctags vocab --- extra/ctags/ctags.factor | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/extra/ctags/ctags.factor b/extra/ctags/ctags.factor index 23d9aeb90c..2ec1208df9 100644 --- a/extra/ctags/ctags.factor +++ b/extra/ctags/ctags.factor @@ -19,19 +19,17 @@ IN: ctags ] "" make ; : ctag-strings ( seq1 -- seq2 ) - { } swap [ ctag suffix ] each ; + [ ctag ] map ; : ctags-write ( seq path -- ) [ ctag-strings ] dip ascii set-file-lines ; : (ctags) ( -- seq ) - { } all-words [ + all-words [ dup where [ - 2array suffix - ] [ - drop - ] if* - ] each ; + 2array + ] when* + ] map [ sequence? ] filter ; : ctags ( path -- ) (ctags) sort-keys swap ctags-write ; \ No newline at end of file