emacs-devel
[Top][All Lists]
Advanced

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

Re: prin1 / princ vs message ?


From: Jean-Christophe Helary
Subject: Re: prin1 / princ vs message ?
Date: Sun, 2 Jul 2017 22:47:55 +0900


On Jul 2, 2017, at 22:21, Tino Calancha <address@hidden> wrote:

Instead of using message to replace that code:

(let ((name "JC"))
(prin1 "My name ")
(princ " is ")
(princ name)
(princ ".\n\n"))

It would be better to use something like:

(let ((sentence (format "My name is %s.\n\n)))
   (prin1 sentence))

That way I keep the possibility to redirect the output somewhere else while making the sentence actually maintainable...
That's sounds pretty OK.
I would just modify a bit your example, because currenty doesn't work,
you get the error:
read-from-minibuffer: End of file during parsing

Yes, I just realized that I had forgotten a lot of required stuff :) Sorry.

As for Noam's question, the mixing is, I guess, intended but was not properly reflected in my example:

(let ((name "JC"))
(princ "My name ")
(princ " is ")
(prin1 name)
(princ ".\n\n"))


Jean-Christophe 

reply via email to

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