title: Catching exceptions from a loop
body: <p>I'm trying to write a Forth word which will drop all items on the stack. I'm using a pretty dumb method, by running an infinite loop with 'drop' and catching the error when 'drop' fails because the stack is empty.</p>
  
  <p>My words are defined as such:</p>
  
  <pre><code>( Infinite drop loop)
  : droploop begin drop true while drop repeat ;
  
  ( Experimental catch with a single drop)
  : dropcatcher ['] drop catch drop ;
  
  ( Like dropcatcher, but with 'droploop' instead of 'drop')
  : dropall  ['] droploop catch drop ;
  </code></pre>
  
  <p>When I run droploop, I get an error like I'd expect and after execution, the stack is empty.
  When I run dropcatcher, it drops if the stack isn't empty, and if the stack is empty it reports nothing.
  When I run dropall, I get all sorts of stuff leftover on the stack.</p>
  
  <p>It looks like this:</p>
  
  <blockquote>
    <p>2 3 4 5 6 7 8 9 10 dropall .s &lt;9> -1 3 -1 5 -1 7 -1 9 -1  ok</p>
  </blockquote>
  
  <p>I'd expect that dropall would simply clear the stack without complaint because droploop and dropcatcher seem to work right by themselves, but alas, I don't understand why dropall isn't working.</p>
  
  <p>Why does dropall seem to work differently than droploop and dropcatcher? Or, what I'm I doing wrong here?</p>