]> gitweb.factorcode.org Git - factor.git/commitdiff
crontab: simplify
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 1 Feb 2024 04:50:22 +0000 (20:50 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 1 Feb 2024 04:50:34 +0000 (20:50 -0800)
extra/crontab/crontab.factor

index 00b6c6fd46c9006d8241a429675a74d72dd16cd4..58873b7f4b32e1a72dbb409963df8ae726971abf 100644 (file)
@@ -15,13 +15,12 @@ TUPLE: cronentry minutes hours days months days-of-week command ;
 
 <PRIVATE
 
-:: parse-range ( from/f to/f quot: ( value -- value' ) seq -- from to )
-    from/f to/f
-    [ [ seq first ] quot if-empty ]
-    [ [ seq last ] quot if-empty ] bi* ; inline
+:: parse-range ( from/f to/f quot: ( input -- value ) seq -- from to )
+    from/f [ seq first ] quot if-empty
+    to/f [ seq last ] quot if-empty ; inline
 
-:: parse-value ( value quot: ( value -- value' ) seq -- value )
-    value {
+:: parse-value ( input quot: ( input -- value ) seq -- value )
+    input {
         { [ dup "*" = ] [ drop seq ] }
         { [ CHAR: , over member? ] [
             "," split [ quot seq parse-value ] map concat ] }