On Mon, Nov 26, 2012 at 11:30 AM, Danny Yoo <d...@hashcollision.org> wrote:
> > I have a trivial task: read a null-terminated string from a stream. >> The size of the string has no predefined limit. How do I do that >> in Racket? I need some resizable thing to store characters, >> like vector<char> in C++ or StringBuilder in C# or Java. >> Does Racket have one? >> >> Following up: more generally, you can find a variety of data structures in the 'data' collection. http://docs.racket-lang.org/data/index.html and it includes growable vectors. For example: ;;;;;;;;;;;;; > (require data/gvector) > (define v (gvector)) > (gvector-add! v "hello") > (gvector-add! v "again") > v #<gvector> > (for ([elt v]) (printf "I see ~s\n" elt)) I see "hello" I see "again" ;;;;;;;;;;;;;
____________________ Racket Users list: http://lists.racket-lang.org/users