[alexandria-devel] Add mkstr and simplify of 'symbolicate

Liam Healy lnp at healy.washington.dc.us
Sun Jan 16 23:42:40 UTC 2011


On Sun, Jan 16, 2011 at 1:17 AM, Daniel Herring <dherring at tentpost.com> wrote:
> On Sat, 15 Jan 2011, Liam Healy wrote:
>
>> (defun mkstr (&rest args)
>>  "Make a string out of the printed representations of the arguments."
>>  (with-output-to-string (s)
>>   (dolist (a args) (princ a s))))
>
> Isn't that the same as
> (defun mkstr (&rest args)
>  "Make a string out of the printed representations of the arguments."
>  (format nil "~{~A~}" args))
> ?
>
> Is this complicated enough to be a standalone, documented function?
>
> - Daniel
>

I think your form of the function would indeed do the same thing.

I don't think complexity is a point on which a utility should be
judged, but rather how useful it is, essentially, how much people have
to repeat its functionality (see for instance ensure-symbol, already
in alexandria, which is simpler than this).  I use mkstr all the time,
and imagine it would be useful to others.  And, since symbolicate is
just the symbol form of the output, it seems that it's useful to
others.

Liam




More information about the alexandria-devel mailing list