Re: [racket] string-strip

2012-01-11 Thread Matthew Flatt
> On 29-12-11 10:02, Marijn wrote: > >>> What I found was that it is much slower to treat a string as a > >>> port and then read-char from that then it is to directly index > >>> the string. > > > >> That string input ports are often noticeably slower than string > >> indexing is one of the ban

Re: [racket] string-strip

2012-01-11 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 29-12-11 10:02, Marijn wrote: >>> What I found was that it is much slower to treat a string as a >>> port and then read-char from that then it is to directly index >>> the string. > >> That string input ports are often noticeably slower than stri

Re: [racket] string-strip

2011-12-29 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 28-12-11 19:27, Neil Van Dyke wrote: > Marijn wrote at 12/28/2011 12:00 PM: >> I don't think my use of this code is very performance, but I >> couldn't help myself, so I looked into making it faster > > This is the best spirit. :) > >> What I foun

Re: [racket] string-strip

2011-12-28 Thread Neil Van Dyke
Marijn wrote at 12/28/2011 12:00 PM: I don't think my use of this code is very performance, but I couldn't help myself, so I looked into making it faster This is the best spirit. :) What I found was that it is much slower to treat a string as a port and then read-char from that then it is to

Re: [racket] string-strip

2011-12-28 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 27-12-11 18:59, Sam Phillips wrote: > On Tue, Dec 27, 2011 at 09:55, Marijn wrote: >> Sometimes I wish for python-like string-strip to be a standard >> function. For example when I want to parse a list of numbers from >> a text-field, I could get

Re: [racket] string-strip

2011-12-27 Thread Neil Van Dyke
Tangential comment: These string operations are convenient to have around, and they can be expedient, but composing with them can make for inefficient evaluation. For example, my first attempt to implement "string->number" (after briefly considering just using "read"), was 17 times faster in a

Re: [racket] string-strip

2011-12-27 Thread Sam Phillips
On Tue, Dec 27, 2011 at 09:55, Marijn wrote: > Sometimes I wish for python-like string-strip to be a standard > function. For example when I want to parse a list of numbers from a > text-field, I could get the string value of the text-field, strip > space from the beginning and end, split on white

[racket] string-strip

2011-12-27 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, Sometimes I wish for python-like string-strip to be a standard function. For example when I want to parse a list of numbers from a text-field, I could get the string value of the text-field, strip space from the beginning and end, split on whitesp