Re: [racket] Text% efficiently iterating over items

2011-12-12 Thread Robby Findler
Oh: what about turning the editor into a port and then using regexp-matching on it? The position of the port will be a delta from where you created the position of the editor. Eg: #lang racket/gui (define t (new text%)) (void (send t load-file (collection-file-path "private/rep.rkt" "drracket")))

Re: [racket] Text% efficiently iterating over items

2011-12-12 Thread Erich Rast
Yes, sorry, I've meant string-snip%. Okay, I'll iterate over snips then, because I need to match whole character sets. Thanks! Best, Erich On Mon, 12 Dec 2011 16:12:13 -0600 Robby Findler wrote: > You might get away with just using the find-string method of text%, > but if not, then you do

Re: [racket] Text% efficiently iterating over items

2011-12-12 Thread Robby Findler
You might get away with just using the find-string method of text%, but if not, then you do have to iterate snip by snip. The positions inside string-snip%s are offsets from the position of the whole snip for characters (is that what you're asking for when you say text-snip%?). Robby On Mon, Dec

[racket] Text% efficiently iterating over items

2011-12-12 Thread Erich Rast
Is there a fast way to iterate over items or words in a text% instance starting from some position. For example, I'd like to go forward or backward starting from a position until a character in a given srfi14 char-set is found. Using a string returned get-text doesn't seem to work in general beca