From ... From: Erik Naggum Subject: Re: string assembly in lisp?? help?? Date: 1999/03/19 Message-ID: <3130830747000326@naggum.no>#1/1 X-Deja-AN: 456448562 References: <36ef4004.20216733@news.columbia.edu> mail-copies-to: never Organization: Naggum Software; +47 8800 8879; http://www.naggum.no Newsgroups: comp.lang.lisp * Lars Marius Garshol | You seem to be correct about this. I didn't know this about COERCE, and I | also wasn't aware of the possibility of directly modifiying strings like | this. (The explanation of this perhaps surprising ignorance is that I'm a | Lisp newbie. :) | | (format t "Trying vector approach.~%") | (time | (dotimes (ix 10000 'ok) | (let ((str (make-array 30 :fill-pointer 0 :adjustable t))) | (vector-push-extend #\a str) | (vector-push-extend #\a str) | (vector-push-extend #\a str) | (vector-push-extend #\a str) | (vector-push-extend #\a str) | (vector-push-extend #\a str) | (vector-push-extend #\a str) | (vector-push-extend #\a str) | (vector-push-extend #\a str) | (vector-push-extend #\a str) | (setq str (coerce str 'string))))) try it like this, instead: (make-array 30 :fill-pointer 0 :adjustable t :element-type 'character) BTW, if you have to time things, you might as well do it with proper declarations and optimizations. otherwise, you don't know what you're timing. #:Erik