220 8994 <52EE4A48.9010006@wanadoo.fr> article
Path: news.gmane.org!not-for-mail
From: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: About implicit binary operator and user defined
 operators (was  n3553 - Swap operator proposal)
Date: Sun, 02 Feb 2014 14:38:16 +0100
Lines: 122
Approved: news@gmane.org
Message-ID: <52EE4A48.9010006@wanadoo.fr>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative;
 boundary="------------030205070309070406060505"
X-Trace: ger.gmane.org 1391348295 30809 80.91.229.3 (2 Feb 2014 13:38:15 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 2 Feb 2014 13:38:15 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDH67CONY4PBBSUUXGLQKGQEK7POTWI@isocpp.org Sun Feb 02 14:38:19 2014
Return-path: <std-proposals+bncBDH67CONY4PBBSUUXGLQKGQEK7POTWI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ee0-f69.google.com ([74.125.83.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDH67CONY4PBBSUUXGLQKGQEK7POTWI@isocpp.org>)
	id 1W9xFb-0006Or-NL
	for gclcip-std-proposals@m.gmane.org; Sun, 02 Feb 2014 14:38:19 +0100
Original-Received: by mail-ee0-f69.google.com with SMTP id b15sf6109370eek.0
        for <gclcip-std-proposals@m.gmane.org>; Sun, 02 Feb 2014 05:38:19 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to
         :subject:x-original-sender:x-original-authentication-results
         :reply-to:precedence:mailing-list:list-id:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe:content-type;
        bh=LjzeCHiRU1rYO1k20uVvmQiiS0tI5CT9uoTuKLxuWls=;
        b=eg1f6YWQT1Adqulb8bQzK/9gvZ7+yXV2mhZEfewC65lp6yFW0MO0YHDbPXA/fEs8Xq
         1MqWlwTLExXXmKHGai0+fC/HBsT4o4+sbvkvFw0q8UGY2bDSiLcaCOiwxxC3tJ0MhKMR
         JkEIuqQujR3R+Qu23Cz1ffvfo/jqfEw6Bap89ujfplt3VHDqgsEgzuVE14kp2gPQynk8
         sZhhaxVSdawkjdKS1k+M7kUYm4pj6NypPmo/dJg/+UMvX0GhZ0eN8LXJkRiRaFu131HS
         3Q3q2BTvQg/ZP0BrOVXdpiAK7s70vW7fmqDiJYzBb3ZjDZ8i+sQCyQ2D8yR1VlSovjjr
         j0ZQ==
X-Gm-Message-State: ALoCoQl6Pt02vF4reuuZy671EL7wuS3dR8u/3LrP7HXphnBLqZDiOZ9L+71arOQNllN2u1zVfJ76
X-Received: by 10.152.189.69 with SMTP id gg5mr14083256lac.9.1391348299040;
        Sun, 02 Feb 2014 05:38:19 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.92.67 with SMTP id ck3ls322691wib.53.gmail; Sun, 02 Feb
 2014 05:38:17 -0800 (PST)
X-Received: by 10.194.90.144 with SMTP id bw16mr20444555wjb.1.1391348297705;
        Sun, 02 Feb 2014 05:38:17 -0800 (PST)
Original-Received: from smtp.smtpout.orange.fr (smtp11.smtpout.orange.fr. [80.12.242.133])
        by mx.google.com with ESMTP id ho1si8400466wjb.145.2014.02.02.05.38.17
        for <std-proposals@isocpp.org>;
        Sun, 02 Feb 2014 05:38:17 -0800 (PST)
Received-SPF: neutral (google.com: 80.12.242.133 is neither permitted nor denied by best guess record for domain of vicente.botet@wanadoo.fr) client-ip=80.12.242.133;
Original-Received: from new-host.home ([92.139.218.179])
	by mwinf5d46 with ME
	id MReG1n00e3spewU03ReHd1; Sun, 02 Feb 2014 14:38:17 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
X-Original-Sender: vicente.botet@wanadoo.fr
X-Original-Authentication-Results: mx.google.com;       spf=neutral
 (google.com: 80.12.242.133 is neither permitted nor denied by best guess
 record for domain of vicente.botet@wanadoo.fr) smtp.mail=vicente.botet@wanadoo.fr
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:8994
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/8994>

This is a multi-part message in MIME format.
--------------030205070309070406060505
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

Le 31/01/14 03:07, Billy O'Neal a =E9crit :
> Is there any reason we really need to make the operator be composed of=20
> symbols?
>
> What about __swap(a, b) ?
>
>
Haskell interpret any 'name' as a binary left associative operator, e.g.

     a 'swap' b;

could mean

     swap(a,b);

Maybe ':' would be more appropriated for C++.

     a :swap: b;

An orthogonal feature could be to be able to define a user operator=20
operator *:symbols:*() (note the symbols are surrounded by two colons)=20
that could allow to define

     A& operator:=3D:(A&x,A&y);
     A& operator:><:(A&x,A&y);

and use it as

     a :=3D: b;
     a :><: b;

What are the pitfalls of such approaches?

Best,
Vicente

--=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/.

--------------030205070309070406060505
Content-Type: text/html; charset=ISO-8859-1

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Le 31/01/14 03:07, Billy O'Neal a
      &eacute;crit&nbsp;:<br>
    </div>
    <blockquote
cite="mid:CAPBZbvz5HBOFD+zoJ6rDowdxdXL0x4Hbf1wB0jUYO6hqaxC+8Q@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Is there any reason we really need to make the operator be
          composed of symbols?</div>
        <div><br>
        </div>
        <div>What about __swap(a, b) ?</div>
      </div>
      <div class="gmail_extra"><br>
      </div>
      <br>
    </blockquote>
    Haskell interpret any 'name' as a binary left associative operator,
    e.g. <br>
    <br>
    &nbsp;&nbsp;&nbsp; a 'swap' b; <br>
    <br>
    could mean <br>
    <br>
    &nbsp;&nbsp;&nbsp; swap(a,b);<br>
    <br>
    Maybe ':' would be more appropriated for C++.<br>
    <br>
    &nbsp;&nbsp;&nbsp; a :swap: b; <br>
    <br>
    An orthogonal feature could be to be able to define a user operator
    operator <b>:symbols:</b>() (note the symbols are surrounded by two
    colons) that could allow to define<br>
    <br>
    &nbsp;&nbsp;&nbsp; A&amp; operator:=:(A&amp;x,A&amp;y);<br>
    &nbsp;&nbsp;&nbsp; A&amp; operator:&gt;&lt;:(A&amp;x,A&amp;y);<br>
    <br>
    and use it as<br>
    <br>
    &nbsp;&nbsp;&nbsp; a :=: b; <br>
    &nbsp;&nbsp;&nbsp; a :&gt;&lt;: b; <br>
    <br>
    What are the pitfalls of such approaches?<br>
    <br>
    Best,<br>
    Vicente
  </body>
</html>

<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 email 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="http://groups.google.com/a/isocpp.org/group/std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/</a>.<br />

--------------030205070309070406060505--

.
