retroforth/interface/io/gopher.retro
crc 00586f3354 move interfaces to interface/
FossilOrigin-Name: 95a4793e965f0787a8664e4dc3a4f49f66098c30c2a209b6a6d7c2c5fb79193a
2019-11-21 19:48:05 +00:00

27 lines
407 B
Text

# Gopher
RETRO has Gopher support via `gopher:get`.
Takes:
destination
server name
port
selector
Returns:
number of characters read
~~~
{{
'io:Gopher var
:identify
@io:Gopher n:zero? [
#5 io:scan-for dup n:negative?
[ drop 'IO_DEVICE_TYPE_0005_NOT_FOUND s:put nl ]
[ !io:Gopher ] choose ] if ;
---reveal---
:gopher:get identify #0 @io:Gopher io:invoke ;
}}
~~~