]> gitweb.factorcode.org Git - factor.git/commitdiff
file-monitor: simplify.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 5 May 2015 22:36:49 +0000 (15:36 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 5 May 2015 22:36:49 +0000 (15:36 -0700)
extra/file-monitor/file-monitor.factor

index a0306644c17b32500e1c1b8c7b2cdae8c9508b35..cacabcd678c75a9a2664e8c0237d7399e571e2e7 100644 (file)
@@ -1,17 +1,14 @@
 ! Copyright (C) 2015 John Benediktsson
 ! See http://factorcode.org/license.txt for BSD license
 
-USING: accessors command-line formatting fry io io.monitors
+USING: accessors command-line formatting io io.monitors
 io.pathnames kernel namespaces sequences ;
 
 IN: file-monitor
 
 : file-monitor-loop ( monitor -- )
-    '[
-        _ next-change
-        [ changed>> ] [ path>> ] bi
-        "%u %s\n" printf flush t
-    ] loop ;
+    dup next-change [ changed>> ] [ path>> ] bi
+    "%u %s\n" printf flush file-monitor-loop ;
 
 : file-monitor-main ( -- )
     command-line get ?first current-directory get or