 
 ERROR: not-a-gopher-url url ;
 
-: gopher* ( url -- item-type byte-array )
+: gopher ( url -- item-type byte-array )
     dup url? [ >url ] unless
     dup protocol>> "gopher" = [ not-a-gopher-url ] unless {
         [ host>> ]

        } cleave "gopher://%s:%s/%s%s" sprintf
    ] if >url ;

: gopher-text ( object -- lines )
    utf8 decode string-lines { "." } split1 drop ;



PRIVATE>

: gopher. ( url -- )
    gopher swap {
        { A_TEXT [ gopher-text [ print ] each ] }
        { A_MENU [ gopher-menu [ gopher-link. ] each ] }
        { A_INDEX [ gopher-menu [ gopher-link. ] each ] }
        { A_GIF [ gopher-gif image. ] }
        [ drop . ]
    } case ;
