Complex-recursive stack effects?
<pre><code>USING: accessors html.parser.analyzer io kernel math namespaces
  present regexp sequences ;
IN: all-roads-to-wiki

SYMBOL: G

: match-good-pages ( a -- ?/f )
  R/ \/wiki\/[^:]*$/ first-match ;

: filter-urls ( tags -- urls )
  find-hrefs [ present ]     map
  [ match-good-pages ]       filter
  [ match-good-pages seq&gt;&gt; ] map ;

: findpath ( url -- url )
  G get =
  [
     ! false
  ]
  [ scrape-html nip
    [
      dup &quot;title&quot; find-by-name drop 1 + swap nth
      text&gt;&gt; R/ - Wikipedia,/ re-split first print
    ]
    [
      &quot;bodyContent&quot; find-by-id-between filter-urls [ findpath ] map
    ] bi
  ] if ; inline recursive

: allroads-entry ( -- a )
  readln &quot;http://en.wikipedia.org/wiki/&quot; prepend G set-global
  &quot;enwp.org/Special:Random&quot; findpath ; inline
</code></pre>
<p>The above code will recurse over every link on Wikipedia until it finds the one it's looking for.</p>
<p>That's okay, because (hopefully) <code>findpath</code> will eventually &quot;return&quot; (i.e. not call itself again) and leave a huge nested data structure on the stack. But when  I try to compile this, I get an <a href="http://docs.factorcode.org/content/word-unbalanced-recursion-error,stack-checker.errors.html" rel="nofollow noreferrer"><code>unbalanced-recursion</code></a> error:</p>
<blockquote>
<p>The recursive word “findpath” leaves with the stack having the wrong height</p>
<p><code>unbalanced-recursion</code>: Thrown when stack effect inference determines that an inline recursive word has an incorrect stack effect declaration.</p>
</blockquote>
<p>No matter what I do, Factor (understandably) complains about the stack effect not matching up. What do I have to do to get this to recurse properly?</p>