         [ fourth >>anchor ]
     } cleave
     dup host>> [ [ "/" or ] change-path ] when ;
+
+M: pathname >url string>> >url ;
 
 : protocol-port ( protocol -- port )
     {

! Copyright (C) 2008, 2011 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel ascii combinators combinators.short-circuit
sequences splitting fry namespaces make assocs arrays strings
io.sockets io.encodings.string io.encodings.utf8 math
math.parser accessors parser strings.parser lexer
hashtables present peg.ebnf urls.encoding ;
IN: urls

TUPLE: url protocol username password host port path query anchor ;

! Literal syntax
SYNTAX: URL" lexer get skip-blank parse-string >url suffix! ;

{ "urls" "prettyprint" } "urls.prettyprint" require-when
{ "urls" "io.sockets.secure" } "urls.secure" require-when
