From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jean-Christophe Helary Newsgroups: gmane.emacs.devel Subject: Re: prin1 / princ vs message ? Date: Sun, 2 Jul 2017 22:47:55 +0900 Message-ID: <86E604C6-4A01-42D2-A3CD-D758FC5DD8B1@gmail.com> References: <061782A1-0A51-49A1-9AA4-706AF8927D01@gmail.com> <94EF128F-6A3D-41DD-B92D-0C165A4A8EB9@gmail.com> <617557F2-0316-4504-BE80-E7F29E4EE347@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_5B63CE1F-3611-45DD-9D0B-20A8BDBC11C9" X-Trace: blaine.gmane.org 1499003328 3957 195.159.176.226 (2 Jul 2017 13:48:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 2 Jul 2017 13:48:48 +0000 (UTC) To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 02 15:48:44 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dRfEu-0000ea-CV for ged-emacs-devel@m.gmane.org; Sun, 02 Jul 2017 15:48:40 +0200 Original-Received: from localhost ([::1]:58112 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRfEz-0005tx-Nm for ged-emacs-devel@m.gmane.org; Sun, 02 Jul 2017 09:48:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRfEL-0005tY-MS for emacs-devel@gnu.org; Sun, 02 Jul 2017 09:48:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dRfEG-0001dv-SD for emacs-devel@gnu.org; Sun, 02 Jul 2017 09:48:05 -0400 Original-Received: from mail-pf0-x236.google.com ([2607:f8b0:400e:c00::236]:35216) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dRfEG-0001dW-Iw for emacs-devel@gnu.org; Sun, 02 Jul 2017 09:48:00 -0400 Original-Received: by mail-pf0-x236.google.com with SMTP id c73so87964847pfk.2 for ; Sun, 02 Jul 2017 06:48:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=U4dygpZ4jcLSfrtQVmll/QLSdjgHiQlY2kCDwHjK5mI=; b=tAgkrbkghhJa/7idmAKcw1VdEwWtrsb6Gkau3WRsysh4g3qlh7CODEU6L3l562Wvda t+ad0gZYM3z4m1sduT+6+fp78FT0lBRD2pdXSsemFNTB0HLRPOKPmDBZRq5zbMLifAJR P0L6RhGb/fiHv3JQDfJv+r93wrR4NSHSU+GYpSekqITvs++oU7oAEvsz9yth6fbKBeG1 gy6ZGL8S+fT/HNjEXL2jBAkoV4B3Z0y65fvv+CYc4xC+e2JJxDW94IxINx2eoCRNtB5P eNGxULIn/i3FuKO9yP/fWf/9Pku4byU5yoeRmE+kSwxLgEIOreIxeq/QJAP1nNLuS64x f/wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=U4dygpZ4jcLSfrtQVmll/QLSdjgHiQlY2kCDwHjK5mI=; b=ac6Z3Uj75Ph029lIaCJAA/qfrfj/zOOUfRwbWsOuOdEZq6E2KNblj0hBJoxuVYPdfy ABVAvm75oY77dG0z2Xjgj7HpCdKaK2JfWJd/nllb3tJ5x2IMMJWmZvR2k1XxKxgyal+p 2FwT+Qr5JQXbsYekX6wo+jsDpTpds4ocWlbZrL5IacAu3ZN1cryWdxuNOkaJqwBB+Sqm MnENddjfoEj9iWSF6xI8ZtXH/EYgRFuC0m95jeE3ACqCLCchtvvVwTlij2lXmeLviPkm f4bSYOxCbxcPP+wwWll557bR74Hg9L+y5jLqZnPeVjYjvNegIta+p2r6mWRmCfE3bx4M h2Ow== X-Gm-Message-State: AIVw11351aFwePgP6UA1KSnBT957m+wjBESFbYhGW8NJMburS/X2uDMr r9uCHdB7WZTxRbqSxdQ= X-Received: by 10.84.217.206 with SMTP id d14mr5452776plj.121.1499003279429; Sun, 02 Jul 2017 06:47:59 -0700 (PDT) Original-Received: from [192.168.24.55] (pl2587.ag0304.nttpc.ne.jp. [128.53.196.27]) by smtp.gmail.com with ESMTPSA id v62sm25564199pfb.124.2017.07.02.06.47.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Jul 2017 06:47:58 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3273) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::236 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:216098 Archived-At: --Apple-Mail=_5B63CE1F-3611-45DD-9D0B-20A8BDBC11C9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Jul 2, 2017, at 22:21, Tino Calancha = wrote: >=20 >> Instead of using message to replace that code: >>=20 >> (let ((name "JC")) >> (prin1 "My name ") >> (princ " is ") >> (princ name) >> (princ ".\n\n")) >>=20 >> It would be better to use something like: >>=20 >> (let ((sentence (format "My name is %s.\n\n))) >> (prin1 sentence)) >>=20 >> 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=20= --Apple-Mail=_5B63CE1F-3611-45DD-9D0B-20A8BDBC11C9 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
On Jul 2, 2017, at 22:21, Tino Calancha <tino.calancha@gmail.com> 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 
= --Apple-Mail=_5B63CE1F-3611-45DD-9D0B-20A8BDBC11C9--