<br><div class="gmail_quote">On Mon, Nov 26, 2012 at 11:31 AM, Robby Findler <span dir="ltr">&lt;<a href="mailto:robby@eecs.northwestern.edu" target="_blank">robby@eecs.northwestern.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

That kind of thing makes a lot of sense to me.<br>
<br>
I&#39;d probably write the code a little bit differently, having a<br>
function that takes a string and sees if the text starting at<br>
start-pos matches that string instead of having to special case the<br>
numbers 1, 2, 3, 5, and 7. This will also let you just put the call to<br>
forward-match in the second arm of the &#39;and&#39;, so you can avoid the<br>
promise.<br>
<br></blockquote><div><br></div><div><br></div><div>Can you elaborate what you mean?  Do you mean to say to do:</div><div><br></div><div>    (get-text pos (min (last-position) (+ pos K)))</div><div> </div><div>for sufficiently large enough K, and then do the string matching from there?</div>

<div><br></div><div><br></div><div>Also do you have an intuition as to why forward-match is expensive?  My understanding is that it only tokenizes the portion of the buffer that got dirty, so there should be so much reuse of the existing tokens that this shouldn&#39;t be that bad.  I guess I need to stare at the code some more.</div>

</div>