retroforth/interface/gopher.retro

28 lines
393 B
Text
Raw Normal View History

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