Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108617 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 27538 invoked from network); 16 Feb 2020 12:16:14 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Feb 2020 12:16:14 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 079381804F8 for ; Sun, 16 Feb 2020 02:31:20 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 16 Feb 2020 02:31:19 -0800 (PST) Received: by mail-wr1-f47.google.com with SMTP id m16so16084480wrx.11 for ; Sun, 16 Feb 2020 02:31:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:to:from:message-id; bh=7r9fu4Q7q1WlUr/iIahnRsGrGnrB8Jvoefftww8mTtE=; b=I9ZrPVExu5h0daXtIX1A8eHBxTFTQNSvQxH7vesbdUKin8GNyPcg32/XMSbWwXC1tL lozYQ2dU4J4FCPx2phVRmtGjPn7tLTOQeef0FrEYSmnhnOFrvo1BJn2p8Dj1RVtwxTRp q+ZpBqW2bI2/JnFau9h/4SD/qh/OKkj68SKzNGQ99s9tX2cjNWj6IBIEr+5ZQGMpqxLO JhB1NmThWmKiNH9fVdo/H61fEmN4QnUaGs6ESYoQRP+jbJ4TtpQ4ou3pYLttwjyGb3fx P8y7jmesHXtL5XkOlYyG5ve8Z5Kd6NFzAOmutklqzBvV1ZxMVjMMMCYL/Qv6Ya91c1zH la6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:from:message-id; bh=7r9fu4Q7q1WlUr/iIahnRsGrGnrB8Jvoefftww8mTtE=; b=Vuevf6ZymmkpxYe0LCutP5YlYsTJl06JWAlD/aZh+kCXvf8OMWk79D/Lq3gjO8zn7E G89iMLbeIprVhRHtVctEWuubNr/UNHP2OOO/oSPkTpKuOIE+1XbixX/pSE3qaYD9MlIC VUHe1Iot7qp0TUO0L8S9HXIRJZCjIwhsCY1pXLzq/ZYHN3vR3mA8tQ32B87SW73UFyB9 nnpEWjKA1DCm4HQHcWOX4zc89d+FlnsaVuDXV8MVZMJM5piheZBOUJrUkJcCaHBMaJe/ O77rAZLbo9DSFK8hDljQvrS3vSfh+IfWUx191lSpHVOJbUaABMGqy7mvpMzNSEAaVQpB kc0A== X-Gm-Message-State: APjAAAVmUiAjKr9bugbvIVXYZbEmvplhqJ3SW3R4QnhbA77AOYWxeyXW 4Wz4UO8FGQk+Upk3npoP0RR4v1gl X-Google-Smtp-Source: APXvYqwuss9G484dsndueasqIaqg2tQTOhIyx5CMWtHDq1neCz7V7/vys0BkDfxSVi46aIGW/Bnyfg== X-Received: by 2002:a5d:6087:: with SMTP id w7mr15127825wrt.36.1581849077299; Sun, 16 Feb 2020 02:31:17 -0800 (PST) Received: from [192.168.0.12] (cpc84253-brig22-2-0-cust114.3-3.cable.virginm.net. [81.108.141.115]) by smtp.gmail.com with ESMTPSA id x7sm15407871wrq.41.2020.02.16.02.31.16 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 16 Feb 2020 02:31:16 -0800 (PST) Date: Sun, 16 Feb 2020 10:31:14 +0000 User-Agent: K-9 Mail for Android In-Reply-To: References: <003801d5e44c$169700e0$43c502a0$@gmx.de> <83988BB2-7C9D-4118-A1A2-253725F1A7EA@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable To: internals@lists.php.net Message-ID: <2E0E7D03-0742-42CD-8C0C-F663CA5E8E90@gmail.com> Subject: Re: [PHP-DEV] [RFC] Userspace operator overloading From: rowan.collins@gmail.com (Rowan Tommins) On 16 February 2020 05:07:03 GMT+00:00, Stanislav Malyshev wrote: >Hi! > >> - The individual symbolic operators, with no intrinsic meaning - e=2Eg= =2E >> overloading =2E for concatenation on strings but dot-product for >> vectors; or a DSL overloading << and >> for "into" and "out of"=2E > >Please no=2E I know it looks fancy and some languages love it, but for a >person not in on the joke reading such code is a nightmare :) I know you're not alone in that feeling=2E If it turns out this is the = majority view, I think it answers a couple of open questions: Overload methods should definitely be named after operations, not symbols,= to remind people they are implementing addition, not giving new meaning to= + They should probably be grouped into interfaces, which this RFC has so far= resisted=2E How often does it make sense for a type to support addition bu= t not subtraction, or multiplication but not division? Even more clearly, i= f a type claims to implement bitwise OR but not bitwise AND, NOT, and XOR, = something is definitely fishy=2E You can't stop people using overloading DSL-style, but you can make it obv= ious that it's not the intention of the feature (if we agree that it's not = the intention; maybe some people here are really hoping to use it that way?= ) Regards, --=20 Rowan Tommins [IMSoP]