From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.devel Subject: Re: concat with separators ? Date: Sun, 28 May 2017 20:27:05 +0900 (JST) Message-ID: References: <23AEA0E0-C320-4DAD-99AB-95A202FF07AC@gmail.com> <783c09c3-60df-e011-6db4-f8560c00cf92@gmail.com> <851096D1-69F3-4904-B2FC-112877D80586@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Trace: blaine.gmane.org 1495970880 16143 195.159.176.226 (28 May 2017 11:28:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 28 May 2017 11:28:00 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Cc: emacs-devel To: Jean-Christophe Helary Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 28 13:27:56 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 1dEwMV-00044x-FN for ged-emacs-devel@m.gmane.org; Sun, 28 May 2017 13:27:55 +0200 Original-Received: from localhost ([::1]:43487 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEwMZ-0003OR-AY for ged-emacs-devel@m.gmane.org; Sun, 28 May 2017 07:27:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEwLr-0003OL-Dp for emacs-devel@gnu.org; Sun, 28 May 2017 07:27:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dEwLm-0003Rc-G6 for emacs-devel@gnu.org; Sun, 28 May 2017 07:27:15 -0400 Original-Received: from mail-pf0-x22c.google.com ([2607:f8b0:400e:c00::22c]:35745) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dEwLm-0003RY-Am for emacs-devel@gnu.org; Sun, 28 May 2017 07:27:10 -0400 Original-Received: by mail-pf0-x22c.google.com with SMTP id n23so36023434pfb.2 for ; Sun, 28 May 2017 04:27:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=dPjZeqgcTuzbuezA6f3guIPhWBMDEnj45AU6begAo1Q=; b=pit7Je2dC/ClPvg02Z78qbye1zrJFTcxcHDjlGUIZXMeeTtTWu+mKUgL8x8XhqqI64 rnfoXbrEgAJAiM5q7mFKAWH8WRVROD1gQizkA1oE57MemkatirG9S8/5Ill3q3Ts9+eZ rE7brd/iX8HuC2YqBwvmg1wUg0TPp3XfeglsHrinfDalYCwGsSCTTQhBVdFtjZl3uMTd T9VTZzp2d/LIpdcIChAR2U2ZgOkvNpMx05eUSvNDjASyKd+c32oDbdT5pvg94lTO1W8b kTH8vlAc22M47s+Y6odI0FfHxApcRpQSw3wwPPmsP852Sml1C4+fpo91HqQDUb4sxsDA Y3+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=dPjZeqgcTuzbuezA6f3guIPhWBMDEnj45AU6begAo1Q=; b=n0Uj5/DTN7j6b5RjIoZwifYqtOZgDU7Tj5iNaGm2xz2pFwJSc7lv6QJjcAa+ZADb1E XKwY1dlX/OBmZLE+LMivqk9B8dO+6jCwZo1RjCB8bN5DUP2wozqquV0/hOh1MvMCdYdW UaXFpbFJCw9ZR+3h6igj0o/olpDbEpBEuIZEvos77VIWPQ1b6rV/QLxm41ADACH37x8u e/l4YWLsBV0ocuihSfvDkgOqW3K3SnA7NjiJqGaJ1O4uUQ65Xl0LWVusVUwJKjfoycP5 J4NZ/ooN2Zct4DBl9SJWGiNEK6eNc1wfVHVoXwRnqibafTRwxpdFuCWVvbIxmFcdOCcB XNrA== X-Gm-Message-State: AODbwcCHCKFguh4y8EL5ZSi/S48oplsUT7YmPDlxj1MIjydTArBoTnfa ouQ7O3urMpdSPA== X-Received: by 10.84.148.134 with SMTP id k6mr68598852pla.55.1495970829404; Sun, 28 May 2017 04:27:09 -0700 (PDT) Original-Received: from calancha-pc (222.139.137.133.dy.bbexcite.jp. [133.137.139.222]) by smtp.gmail.com with ESMTPSA id k86sm11360468pfk.125.2017.05.28.04.27.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 May 2017 04:27:08 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: <851096D1-69F3-4904-B2FC-112877D80586@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::22c 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:215280 Archived-At: On Sun, 28 May 2017, Jean-Christophe Helary wrote: > >> On May 28, 2017, at 19:52, Tino Calancha wrote: >> >>>>> That's roughly the definition of string-join in subr-x: >>>>> >>>>> (defsubst string-join (strings &optional separator) >>>>> "Join all STRINGS using SEPARATOR." >>>>> (mapconcat 'identity strings separator)) >>> >>> Would it be acceptable to provide separators to concat or is it preferable to use string-join instead? > >> The latter. >> Func. `concat' accepts any arbitrary number of sequences (not a list of >> sequences as `string-join'). > > I know that, but subr-x is experimental (hence not documented in the manual) and having to use mapconcat just to add a separator seems not practical. I wouldn't worry too much about `string-join' not being in the manual. It's going to keep there. If it's convenient for you feel free to use it. Many people here like to use stuff from subr-x.el. Or you can create in your package a `foo-string-join' (foo being your package prefix). Once you write your package manual, this function will be documented in the Emacs manual as well. We cannot modify `concat' with a new argument `separator' without breaking existent code. You can pass the separator between strings: (concat "foo" ":" "bar" ":" "qux") => "foo:bar:qux" Or use format: (format "%s:%s:%s" "foo" "bar" "qux") => "foo:bar:qux"