From ... From: Erik Naggum Subject: Re: Search & Replace in sequences Date: 2000/03/20 Message-ID: <3162509869683633@naggum.no>#1/1 X-Deja-AN: 599771583 References: mail-copies-to: never Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsmaster@eunet.no X-Trace: oslo-nntp.eunet.no 953521087 16935 195.0.192.66 (20 Mar 2000 02:58:07 GMT) Organization: Naggum Software; vox: +47 8800 8879; fax: +47 8800 8601; http://www.naggum.no User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.5 Mime-Version: 1.0 NNTP-Posting-Date: 20 Mar 2000 02:58:07 GMT Newsgroups: comp.lang.lisp * Rudolf Schlatte | This works ok and the program does not have to run fast or anything, but | all this repeated string-building just feels wrong for me. Are there | more concise ways of writing this? yes, use with-output-to-string and write characters and strings to the string stream with stream primitives like write-char and write-string. the underlying buffering mechanism is very well optimized for growing strings, which is what you are doing in an excessively expensive way. C and Perl don't have string streams, so every C and Perl programmer thinks in-memory string processing is more efficient than streams and that you always benefit from doing your own buffering algorithm. neither is, was, or will become true. languages shape the way we think, or don't. #:Erik