From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Simple stringification
Date: Mon, 22 Feb 2010 19:01:36 +0100 [thread overview]
Message-ID: <4B82C680.8050109@easy-emacs.de> (raw)
In-Reply-To: <m37hq56ulu.fsf@palantirtech.com>
Sean McAfee wrote:
> 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?
>
(string 88 99 ) --> "Xc"
(number-to-string 34)"34"
BTW I'm living well with format meanwhile, inserted via abbrev.
Andreas
next prev parent reply other threads:[~2010-02-22 18:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-22 17:36 Simple stringification Sean McAfee
2010-02-22 18:01 ` Andreas Röhler [this message]
[not found] ` <874ol95chl.fsf@galatea.lan.informatimago.com>
2010-02-24 20:13 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B82C680.8050109@easy-emacs.de \
--to=andreas.roehler@easy-emacs.de \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.