     '[ _ [ second @ ] find-from rot drop swap 1+ ]
     [ f 0 ] 2dip times drop first2 ; inline
 
-: find-first-name ( str vector -- i/f tag/f )
-    [ >lower ] dip [ name>> = ] with find ; inline
+: find-first-name ( vector string -- i/f tag/f )
+    >lower '[ name>> _ = ] find ; inline
 
-: find-matching-close ( str vector -- i/f tag/f )
-    [ >lower ] dip
-    [ [ name>> = ] [ closing?>> ] bi and ] with find ; inline
+: find-matching-close ( vector string -- i/f tag/f )
+    >lower
+    '[ [ name>> _ = ] [ closing?>> ] bi and ] find ; inline
 
-: find-between* ( i/f tag/f vector -- vector )
-    pick integer? [
-        rot tail-slice
-        >r name>> r>
-        [ find-matching-close drop dup [ 1+ ] when ] keep
-        swap [ head ] [ first ] if*
+: find-between* ( vector i/f tag/f -- vector )
+    over integer? [
+        [ tail-slice ] [ name>> ] bi*
+        dupd find-matching-close drop dup [ 1+ ] when
+        [ head ] [ first ] if*
     ] [
         3drop V{ } clone
     ] if ; inline
-    
-: find-between ( i/f tag/f vector -- vector )
+
+: find-between ( vector i/f tag/f -- vector )
     find-between* dup length 3 >= [
         [ rest-slice but-last-slice ] keep like
     ] when ; inline
 
-: find-between-first ( string vector -- vector' )
-    [ find-first-name ] keep find-between ; inline
+: find-between-first ( vector string -- vector' )
+    dupd find-first-name find-between ; inline
 
 : find-between-all ( vector quot -- seq )
-    [ [ [ closing?>> not ] bi and ] curry find-all ] curry
-    [ [ >r first2 r> find-between* ] curry map ] bi ; inline
-
+    dupd
+    '[ _ [ closing?>> not ] bi and ] find-all
+    [ first2 find-between* ] with map ;
 
 : remove-blank-text ( vector -- vector' )
     [

    swap [ >r first2 r> find-between* ] curry map
    [ [ name>> { "form" "input" } member? ] filter ] map ;

: find-html-objects ( string vector -- vector' )
    [ find-opening-tags-by-name ] keep
    [ [ first2 ] dip find-between* ] curry map ;

: form-action ( vector -- string )
    [ name>> "form" = ] find nip 

USING: assocs html.parser kernel math sequences strings ascii
arrays generalizations shuffle unicode.case namespaces make
splitting http accessors io combinators http.client urls
urls.encoding fry prettyprint ;
IN: html.parser.analyzer

TUPLE: link attributes clickable ;
