retroforth/source/interfaces/io/gopher.retro
crc e812604b69 begin use of .retro instead of .forth
FossilOrigin-Name: e0338302de74d2255f06b867fa479c31357f4f6916b58f7a309854a471fc2710
2019-06-28 14:17:50 +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 ;
}}
~~~