<?xml version="1.0"?>
<paste-with-annotations>
  <paste>
    <number>
      <integer>53252</integer>
    </number>
    <user>
      <string>|Agent</string>
    </user>
    <title>
      <string>seq implementation</string>
    </title>
    <contents>
      <string>define method seq (#rest sub-rules :: &lt;function&gt;) =&gt; (rule :: &lt;function&gt;)
   method (stream) =&gt; (success, tokens)
      let pos = stream.stream-position;
      let product = make(&lt;stretchy-sequence&gt;);
      let failed = #f;
      for (rule in sub-rules, until: failed)
         let (success, tokens) = rule(stream);
         if (success)
            product := product.add!(tokens)
         else
            failed := rule
         end if
      end for;
      if (failed)
         stream.stream-position := pos;
         product := make(&lt;parser-error&gt;,
               format-string: &quot;Expected %s&quot;, format-args: $rule-names[rule])
      end if;
      values(~failed, product)
   end method
end method;

</string>
    </contents>
    <universal-time>
      <integer>3407964733</integer>
    </universal-time>
    <channel>
      <string>#dylan</string>
    </channel>
    <colorization-mode>
      <string></string>
    </colorization-mode>
    <maybe-spam>
      <null/>
    </maybe-spam>
    <is-unicode>
      <null/>
    </is-unicode>
  </paste>
</paste-with-annotations>