Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116627 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 40631 invoked from network); 12 Dec 2021 17:29:39 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Dec 2021 17:29:39 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 163371804DF for ; Sun, 12 Dec 2021 10:31:09 -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.0 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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-ua1-f44.google.com (mail-ua1-f44.google.com [209.85.222.44]) (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, 12 Dec 2021 10:31:08 -0800 (PST) Received: by mail-ua1-f44.google.com with SMTP id n9so6641237uaq.10 for ; Sun, 12 Dec 2021 10:31:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wJsDeaVkeiI+r3M4cLcAWsAEPDJNs1G46SxKxlePS3Y=; b=nhWERo73yG2gjUT88vcmZVdeWC5vpnTBOmhrhq6t5gd1Az0OwnQoD3BetMCzeZthnv 7QezvrOe6SF5K9UlmOm1VWJtau5bDe4RC8oAkiTDwcIxxb6KKOp47N5onQxR7dT72ty/ y1moIc6zmMoJmt0L/c4OsqKIWQzVDAUsJG+5Ay+F9maRyTn8qIip/rC6PTjHpHHrnq5W lRxqy6Av4i8FwCZ8FaFOu/Z1/bb0B4XTbD60Z8sWePV4+KDhKJtOokVH5+oO8x5poKAs iAyQ6Pp7reZJM3pCNZGmOoF8A8Ncl840AAbWoMatGVlJ82Iwpp53Pa5UHysw620aL0QH XeVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wJsDeaVkeiI+r3M4cLcAWsAEPDJNs1G46SxKxlePS3Y=; b=TwZL80Au+fqShp64nqbwDJ1zbuk3VvbPYnweMf/XSpDWG6mR0U/qzAWwsMfe3wdaN3 G6gnUdea2fKwASwQUOlrKUlJ4ndwfKEdUCQaqlQi47qa/KR/p+6x0Jka2sIJmvddTRPf Fw2RIcRKXtio1Y5YbYW0yEXk5oKK+o/GaP7DczKUjY9yyaHgm5kb9fHKnb7Tla94oMkF IEn0e6VabypLhgRvxHwxnZc9HmSmMewfyBpXRGG171TDRDFygpRIvvzDnCaIg6/dMeIP AV6hXwRngujC+iyP2Ll9u+bq/YCmKoEzPjw0Nuy8QIfMvXUPvIU/MPMSextgcPAEbutT MnZA== X-Gm-Message-State: AOAM532+zBf03do6CYcpycR7+YXBTrzI3ngW/A/+ZjC50dMdhLR7meE6 UHVQdCKvmDwOgTxrcWdCV49kfZIfHOZxUhHa56U9xQ== X-Google-Smtp-Source: ABdhPJyVXVSqAdpl6Ft/JkgUKa9i7CxOJbIRdKbOF7t0DnzlDg3k4rFtHpJSXwWW+jLtjnxJ3tYa/xTVlMYsL6IM3bs= X-Received: by 2002:a67:fdc3:: with SMTP id l3mr24847651vsq.42.1639333867955; Sun, 12 Dec 2021 10:31:07 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Sun, 12 Dec 2021 18:30:54 +0000 Message-ID: To: james@asgrim.com Cc: Jordan LeDoux , PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] User Defined Operator Overloads (v0.6) From: Danack@basereality.com (Dan Ackroyd) On Sun, 12 Dec 2021 at 08:55, James Titcumb wrote: > > The only mitigation for unnecessary complexity I can think of is to force > overloaded operators to be "arrow functions" to encourage only minimal > code, e.g. > The 'valid' use-cases for this aren't going to minimal pieces of code. Things like a matrix object that supports multiplying by the various things that matrices can be multiplied by won't fit into an arrow function. Also, I fundamentally disagree with making stuff difficult to use to 'punsish' users who want to use that feature. If you want to enforce something like a max line length in a coding standard, or forbidding usage of a feature, that is up to you and any code style tool you use. > I just think the desire to use this in ways it shouldn't be > used will be too great, It might be an idea to add a list of bad examples to the RFC, so people can refer to how not to use it, rather than each programming team having to make the same mistakes. cheers Dan Ack