retroforth/interface/gopher.retro
crc e4eb91eb79 io devices: reduce memory usage
FossilOrigin-Name: 0787996383d82ab30c7b62dc4adf38c8360c6849f8e3b9d23f9e788d2d5322c7
2020-11-19 19:33:47 +00:00

27 lines
394 B
Text

# 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? 0; drop
#5 io:scan-for dup n:negative?
[ drop 'IO_DEVICE_TYPE_0005_NOT_FOUND s:put nl ]
[ !Gopher ] choose ;
---reveal---
:gopher:get identify #0 @Gopher io:invoke ;
}}
~~~