     drop resolve-localhost ;
 
 M: object resolve-localhost
-    ipv6-supported? [
-        { T{ ipv4 f "0.0.0.0" } T{ ipv6 f "::" } }
-    ] [
-        { T{ ipv4 f "0.0.0.0" } }
-    ] if ;
+    ipv6-supported?
+    { T{ ipv4 f "0.0.0.0" } T{ ipv6 f "::" } }
+    { T{ ipv4 f "0.0.0.0" } }
+    ? ;
 
 : host-name ( -- string )
     256 <byte-array> dup dup length gethostname

MEMO: ipv6-supported? ( -- ? )
    [ "::1" 0 <inet6> binary <server> dispose t ] [ drop f ] recover ;

[ \ ipv6-supported? reset-memoized ipv6-supported? drop ]
"ipv6-support-check" add-startup-hook

GENERIC: resolve-host ( addrspec -- seq )



HOOK: (datagram) io-backend ( addr -- datagram )

TUPLE: raw-port < port addr ;

HOOK: (raw) io-backend ( addr -- raw )
