[Top][All Lists]

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

Re: prin1 / princ vs message ?

From: Tino Calancha
Subject: Re: prin1 / princ vs message ?
Date: Sun, 2 Jul 2017 22:21:35 +0900 (JST)
User-agent: Alpine 2.20 (DEB 67 2015-01-07)

On Sun, 2 Jul 2017, Jean-Christophe Helary wrote:

Tony, Noam,

Thank you very much for the clarifications.

So, since I expect the developer to know the difference between the prin? 
collection and message could you tell me if the following is correct:

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

The following must work:
(let ((sentence
       (format "My name is %s.\n\n"
               "Tino, but often people call me Tony.  Who cares? :-)")))
  (prin1 sentence))

reply via email to

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