help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Simple stringification


From: Sean McAfee
Subject: Simple stringification
Date: Mon, 22 Feb 2010 09:36:13 -0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux)

I recently needed a function that stringifies its argument.  I wrote my
own:

(defun stringify (arg)
  (format "%s" arg))

But then I thought that Emacs probably ought to offer a standalone
function for this.  I can't find one, though.  The docs for the format
function state that the "%s" format sequence uses princ to print any
object.  However, (princ my-object) also prints the stringification of
my-object to the echo area, unless called with an additional argument,
eg. (princ my-object 'identity).

Is there in fact a function that stringifies its single argument, and
does nothing else?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]