unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jean-Christophe Helary <brandelune@gmail.com>
To: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: concat vs format
Date: Sun, 9 Dec 2018 19:02:01 +0900	[thread overview]
Message-ID: <4A03F880-46F5-47AA-BFA9-7CA09FB9D7AA@gmail.com> (raw)
In-Reply-To: <a91ff9fb-a52c-4a2f-8b57-5d108f502e68@default>



> On Dec 9, 2018, at 13:09, Drew Adams <drew.adams@oracle.com> wrote:
> 
>> Is there a difference between:
>> (concat firstPartofURL secondPartofURL) and
>> (format "%s%s" firstPartofURL secondPartofURL)?
> 
> If both args are strings then no; the result
> is the same.  But the functions are very
> different - they take different args and,
> aside from some cases like this one where
> the result is the same for some args, their
> uses/purposes are different.

Thank you.

I'm trying to create URLs from dates and at one point I get a concat that outputs "/path/to/url/..." instead of "/path/to/url/12/04/index.html".
I checked the code and put format instead of concat and got the same result. All the things I try to concat are strings that I progressively build over other strings, and edebug gives me correct values up to the point where the wrong string is created...

I'm going to re-check the whole thing...

Jean-Christophe Helary
-----------------------------------------------
http://mac4translators.blogspot.com @brandelune




  reply	other threads:[~2018-12-09 10:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-09  3:50 concat vs format Jean-Christophe Helary
2018-12-09  4:09 ` Drew Adams
2018-12-09 10:02   ` Jean-Christophe Helary [this message]
2018-12-09 11:30     ` Stefan Huchler
2018-12-09 13:42       ` Jean-Christophe Helary
2018-12-09 14:15         ` Stefan Monnier
2018-12-09 14:55           ` Jean-Christophe Helary
2018-12-09 14:57         ` Stephen Berman
2018-12-09 15:44           ` Jean-Christophe Helary

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A03F880-46F5-47AA-BFA9-7CA09FB9D7AA@gmail.com \
    --to=brandelune@gmail.com \
    --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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).