Handbook
Glossary
argconvert ( str/f converter -- val )
Vocabulary
command-line
.
parser
.
private
Inputs
str/f
an
object
converter
an
object
Outputs
val
an
object
Definition
USING:
arrays
combinators
generic.math
io.sockets
kernel
lexer
math.parser
quotations
random
sequences
splitting
strings
vocabs.parser
;
IN:
command-line.parser.private
:
argconvert
( str/f converter -- val )
dup
quotation?
[
( str -- val )
call-effect
]
[
{
{
f
[
]
}
{
string
[
]
}
{
object
[
[
1array
<lexer>
~quotation~
with-lexer
]
with-manifest
]
}
{
boolean
[
{
~array~ ~array~ ~quotation~
}
cond
]
}
{
hostname
[
hostname
boa
]
}
{
inet
[
":"
split1
string>number
<inet>
]
}
{
inet4
[
":"
split1
[
ipv4
argconvert
]
[
string>number
]
bi*
<inet4>
]
}
{
inet6
[
":"
split1
[
ipv6
argconvert
]
[
string>number
]
bi*
<inet6>
]
}
{
ipv4
[
resolve-host
[
ipv4?
]
filter
random
]
}
{
ipv6
[
resolve-host
[
ipv6?
]
filter
random
]
}
[
dup
math-class?
[
drop
string>number
]
[
cannot-convert-value
]
if
]
}
case
]
if
;