Handbook
Glossary
gopher ( url -- item-type byte-array )
Vocabulary
gopher
Inputs
url
an
object
Outputs
item-type
an
object
byte-array
an
object
Definition
USING:
accessors
calendar
combinators
gopher.private
io
io.encodings.binary
io.sockets
io.timeouts
kernel
namespaces
sequences
urls
urls.encoding
;
IN:
gopher
:
gopher
( url -- item-type byte-array )
>url
dup
protocol>>
"gopher"
=
[
not-a-gopher-url
]
unless
{
[
host>>
]
[
port>>
70
or
<inet>
binary
]
[
path>>
rest
[
"1/"
]
when-empty
]
[
query>>
[
assoc>query
url-decode
"?"
glue
]
when*
]
}
cleave
[
[
1
minutes
input-stream
get
set-timeout
]
]
dip
[
gopher-get
]
curry
compose
with-client
;