retroforth/source/interfaces/io/gopher.forth
crc f7a0698486 source tree reorganizations
FossilOrigin-Name: 654eda2d23299be894f94e8b615e7432de6a3bd5dbb6f4caa454cc20e65a510b
2019-05-02 16:25:16 +00:00

27 lines
407 B
Forth

# 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 ;
}}
~~~