retroforth/interfaces/io_gopher.forth
crc ad50177feb i/o scanner done
FossilOrigin-Name: 7be8caac6c03773c654d6402875e067b3b69369866ba369c67c20f011195c5f2
2018-11-23 20:38:46 +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 ;
}}
~~~