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

2012-11-26 Thread Robby Findler
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

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

2012-11-26 Thread Danny Yoo
On Mon, Nov 26, 2012 at 11:31 AM, Robby Findler ro...@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

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

2012-11-26 Thread Robby Findler
I'd write a helper function like this: (define (has? str) (equal? str (get-text start-pos (+ start-pos (string-length str) and call it a bunch (inside an 'or', one branch for each of those strings that are currently in the second argument to member; or well, even use a for/or, I guess). Or,

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

2012-11-26 Thread Danny Yoo
and call it a bunch (inside an 'or', one branch for each of those strings that are currently in the second argument to member; or well, even use a for/or, I guess). Or, if you wanted, you could change your existing code to push the 'or' inside the 'and' and then drop the promise. Ok, I'll

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

2012-11-26 Thread Robby Findler
If you're really worried about the allocation, you can work at the snip level and pass in a buffer to be filled in with characters, you know. :) On Mon, Nov 26, 2012 at 2:44 PM, Danny Yoo d...@hashcollision.org wrote: and call it a bunch (inside an 'or', one branch for each of those strings

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

2012-11-25 Thread Danny Yoo
At least, as far as I can tell, it does not perform any better than the splay tree. It's actually about a second slower when indenting drracket/private/unit.rkt. Darn it. However, I did find something that's slightly nutty: the following patch appears to greatly improve indentation: