220 7448 <fcf8d15e-af56-4351-bc4b-2e5984399240@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Vlad from Moscow <vlad.moscow@mail.ru>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: To add the method append for all sequential
 containers that have method push_back
Date: Wed, 23 Oct 2013 09:20:43 -0700 (PDT)
Lines: 154
Approved: news@gmane.org
Message-ID: <fcf8d15e-af56-4351-bc4b-2e5984399240@isocpp.org>
References: <4167b82e-a3cc-44ce-9825-b52514bc1531@isocpp.org>	<357325b0-cec5-4d22-ad56-9bb66f76b458@isocpp.org>	<c98342aa-14d6-4fc6-8499-234c5e44e894@isocpp.org>	<983ff074-5d8c-488a-b06c-49d53d5b7a5b@isocpp.org>	<f47679d2-be05-4fdf-aea6-c617eb291aad@isocpp.org>	<369298d9-3f8b-405a-8bfe-ae209372a26f@isocpp.org>	<CAPBZbvzVuUKHsNSWz+KQPBzB1KJh0KgaY_cv6XuCwuhbZRhgHw@mail.gmail.com>	<f844b34d-f64b-430d-9328-e44246a89238@isocpp.org>	<f651b25b-213e-4c22-bd6e-17c96fde46a7@isocpp.org>	<e826236a-84aa-4623-9510-014881b55004@isocpp.org>	<5266DEEC.7090805@gmail.com>	<eec4b9ca-711c-4b64-bac5-3c08bd3361a8@isocpp.org>	<7c9a2637-65d8-4d54-bd3c-b46c0c22b34f@isocpp.org>	<70a718dd-eca7-4845-8e9c-0313581ed453@isocpp.org>	<6b9f62b2-21b1-4c62-a815-217d77a59a23@isocpp.org>	<df68e700-1cb4-4af5-ba94-e4b589f33e0e@is
 ocpp.org>	<0e98fae6-2dc5-4e50-8659-5334012c4dd4@isocpp.org>	<0d945506-2a09-4645-a68e-ada2b9898aa9@isocpp.org>	<69dd52d3-c35e-4391-b998-d1a35c4599d6@isocpp.org>	<CAFk2RUZ5zEFU_jwSn0kWyCN3h1Bd+yk0ObD9kZ0Ww2O7umdoqA@mail.gmail.com>	<e853f305-0999-437a-840c-3d829a24566d@isocpp.org>	<CAGg_6+OvEyyLFZcGqo2xc0aDu4MeYiCmWMymW1YVNPJqJ1+S7A@mail.gmail.com>	<CAFk2RUYQ1LkfCO5yXWPeStcadYuz7AO4V5bH=mfQMFNm45GM0Q@mail.gmail.com>
 <CAGsORuAyVwKGwdGMyAc3rg1KbOA3AXuYWwgubkXgt-oQRH9AiQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_441_20704577.1382545243045"
X-Trace: ger.gmane.org 1382545244 20906 80.91.229.3 (23 Oct 2013 16:20:44 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 23 Oct 2013 16:20:44 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCXLLRHD7IDRBW7OT6JQKGQE6GNTE2Y@isocpp.org Wed Oct 23 18:20:49 2013
Return-path: <std-proposals+bncBCXLLRHD7IDRBW7OT6JQKGQE6GNTE2Y@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pa0-f69.google.com ([209.85.220.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCXLLRHD7IDRBW7OT6JQKGQE6GNTE2Y@isocpp.org>)
	id 1VZ1As-0004hD-Pt
	for gclcip-std-proposals@m.gmane.org; Wed, 23 Oct 2013 18:20:47 +0200
Original-Received: by mail-pa0-f69.google.com with SMTP id kq14sf2203377pab.0
        for <gclcip-std-proposals@m.gmane.org>; Wed, 23 Oct 2013 09:20:45 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type;
        bh=pBIs6i7RUfYlV4DB1NDCpMh46Z9U7ZNbXyYYMDRNxwE=;
        b=jXHa1pT0qHSQFZf8D0sW4p9KNF7a4MhvSIyHdBV7HfVippDi9rU/6QxewfxqZv4jhp
         3RnfXoNhJsbJkw83vDA0xbgSguKM2ZG/UBgExHurGMpN/ed1MWqQTtNEZVmgm2VAIOL4
         QwZ9gGPOpkmVTjBFfE2YF0VQH5yOtv4ICj0HvhxB2Z76kPN+3YYJeS4wwMmXMCxAXvkt
         nYqJ3npgPVFgI8AvM1FEp00C/SSdMvH+OLJWLCijjYcanUcMeDKZw4KW+WKUzaogK77w
         lh6tkHXEoxF0Or/nemUS51CdiJ51ZmkmfR5sypWClzjDhVk2LHsRpq3v6wh8CahbvJWk
         +zMA==
X-Received: by 10.68.137.163 with SMTP id qj3mr1002137pbb.4.1382545245341;
        Wed, 23 Oct 2013 09:20:45 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.39.163 with SMTP id q3ls520664qek.31.gmail; Wed, 23 Oct
 2013 09:20:43 -0700 (PDT)
X-Received: by 10.49.51.197 with SMTP id m5mr76216qeo.5.1382545243578;
        Wed, 23 Oct 2013 09:20:43 -0700 (PDT)
In-Reply-To: <CAGsORuAyVwKGwdGMyAc3rg1KbOA3AXuYWwgubkXgt-oQRH9AiQ@mail.gmail.com>
X-Original-Sender: vlad.moscow@mail.ru
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:7448
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/7448>

------=_Part_441_20704577.1382545243045
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

append shows more clear the intention of the programmer. Consider code
=20
v.insert( it, std::begin( a ), std:;end( a ) );
=20
You can say nothing whether the array is indeed inserted or appended.=20
=20
Word insert only confuses readers because literally insert and append have=
=20
different meaning.
=20
So in my opinion all sequantial containers with method push_back should=20
have the following set of methods:
=20
assign
insert
append
erase
=20
and all these methods shall have the following parameters
=20
size_type n, const T &value;
InputIterator first, InputIterator last
initializer_list<value_type>
=20
in this case they will be interchangeable with clear semantic of their=20
methods.
..=20
=20

=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 19:04:07 UTC+4 =D0=CF=
=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Zhihao Yuan =CE=C1=D0=C9=D3=C1=CC:

> On Wed, Oct 23, 2013 at 8:02 AM, Ville Voutilainen=20
> <ville.vo...@gmail.com <javascript:>> wrote:=20
> > I have found that novices often expect an append() to be available, but=
=20
> cope=20
> > quite quickly=20
> > when told that it's named push_back().=20
>
> Interestingly in Python `push_back` is named `append`, and=20
> "bulk insertion at the end" is named `extend` :)=20
>
> > The iterator version is much rarer,=20
> > as is chaining=20
> > or otherwise combining multiple appends.=20
>
> If it takes a Range, like Python's `extend`, which takes an=20
> iterable object, that would be more useful, I think :)=20
>
> I always uses string .append() line by line; chained side-=20
> effects are unnecessary and confusing to me.=20
>
> > Meh, indeed. I'll stay well out of=20
> > the room if=20
> > LEWG wishes to discuss this. :)=20
>
> lol=20
>
> --=20
> Zhihao Yuan, ID lichray=20
> The best way to predict the future is to invent it.=20
> ___________________________________________________=20
> 4BSD -- http://4bsd.biz/=20
>

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_441_20704577.1382545243045
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>append shows more clear the intention of the programm=
er. Consider code</div><div>&nbsp;</div><div>v.insert( it, std::begin( a ),=
 std:;end( a ) );</div><div>&nbsp;</div><div>You can say nothing whether th=
e array is indeed inserted or appended. </div><div>&nbsp;</div><div>Word in=
sert only confuses readers because literally insert and append have differe=
nt meaning.</div><div>&nbsp;</div><div>So in my opinion all sequantial cont=
ainers with method push_back should have the following set of methods:</div=
><div>&nbsp;</div><div>assign</div><div>insert</div><div>append</div><div>e=
rase</div><div>&nbsp;</div><div>and all these methods shall have the follow=
ing parameters</div><div>&nbsp;</div><div>size_type n, const T &amp;value;<=
/div><div>InputIterator first, InputIterator last</div><div>initializer_lis=
t&lt;value_type&gt;</div><div>&nbsp;</div><div>in this case they will be in=
terchangeable with clear semantic of their methods.</div><div>. </div><div>=
&nbsp;</div><div><br>=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013&nbsp;=
=C7., 19:04:07 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Zhihao Yuan =CE=
=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gmail_quote" style=3D"margin:=
 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204=
); border-left-width: 1px; border-left-style: solid;">On Wed, Oct 23, 2013 =
at 8:02 AM, Ville Voutilainen
<br>&lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
YYRXyeHujcMJ">ville.vo...@gmail.com</a>&gt; wrote:
<br>&gt; I have found that novices often expect an append() to be available=
, but cope
<br>&gt; quite quickly
<br>&gt; when told that it's named push_back().
<br>
<br>Interestingly in Python `push_back` is named `append`, and
<br>"bulk insertion at the end" is named `extend` :)
<br>
<br>&gt; The iterator version is much rarer,
<br>&gt; as is chaining
<br>&gt; or otherwise combining multiple appends.
<br>
<br>If it takes a Range, like Python's `extend`, which takes an
<br>iterable object, that would be more useful, I think :)
<br>
<br>I always uses string .append() line by line; chained side-
<br>effects are unnecessary and confusing to me.
<br>
<br>&gt; Meh, indeed. I'll stay well out of
<br>&gt; the room if
<br>&gt; LEWG wishes to discuss this. :)
<br>
<br>lol
<br>
<br>--=20
<br>Zhihao Yuan, ID lichray
<br>The best way to predict the future is to invent it.
<br>______________________________<wbr>_____________________
<br>4BSD -- <a href=3D"http://4bsd.biz/" target=3D"_blank">http://4bsd.biz/=
</a>
<br></blockquote></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_441_20704577.1382545243045--

.
