[racket-dev] indentation: the rb tree didn't help, but a hack to stick-to-next-sexp might

From: Danny Yoo (dyoo at hashcollision.org)
Date: Mon Nov 26 13:45:17 EST 2012

On Mon, Nov 26, 2012 at 11:31 AM, Robby Findler <robby at eecs.northwestern.edu
> wrote:

> That kind of thing makes a lot of sense to me.
>
> I'd probably write the code a little bit differently, having a
> function that takes a string and sees if the text starting at
> start-pos matches that string instead of having to special case the
> numbers 1, 2, 3, 5, and 7. This will also let you just put the call to
> forward-match in the second arm of the 'and', so you can avoid the
> promise.
>
>

Can you elaborate what you mean?  Do you mean to say to do:

    (get-text pos (min (last-position) (+ pos K)))

for sufficiently large enough K, and then do the string matching from there?


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't be that bad.  I guess I need to stare at the code some more.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20121126/e0473c04/attachment.html>

Posted on the dev mailing list.