Handbook
Glossary
parse-value ( input quot: ( input -- value ) seq -- value )
Vocabulary
crontab
.
private
Inputs
input
an
object
quot
a
quotation
with stack effect
( input -- value )
seq
an
object
Outputs
value
an
object
Definition
USING:
arrays
combinators
kernel
math
math.parser
random
ranges
sequences
sets
sorting
splitting
;
IN:
crontab.private
::
parse-value
( input quot: ( input -- value ) seq -- value )
input
{
{
[
dup
"*"
=
]
[
drop
seq
]
}
{
[
44
over
member?
]
[
","
split
[
quot seq
parse-value
]
map
concat
]
}
{
[
47
over
member?
]
[
"/"
split1
[
quot seq
parse-value
dup
length
1
=
[
seq
swap
first
seq
index
seq
length
]
[
0
over
length
]
if
1
-
]
dip
string>number
<range>
swap
nths
]
}
{
[
45
over
member?
]
[
"-"
split1
quot seq
parse-range
[a..b]
]
}
{
[
126
over
member?
]
[
"~"
split1
quot seq
parse-range
[a..b]
random
1array
]
}
[
quot
call
1array
]
}
cond
members
sort
;
inline
recursive