Re: code duplication: (setq r (concatenate 'string r (format nil ...



Bigos <ruby.object@xxxxxxxxxxxxxx> writes:

Hi,

I wrote a function where half of the code starts with:

setq r (concatenate 'string r (format nil ...

Is there a better way to do it?

If it's the same "r", you should probably look at
with-output-to-string... something like

(with-output-to-string (s)
(format s ...)
(format s ...))

=> returns everything concatenated into (or written to) s.

.