Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124016 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 2A14B1ADA77 for ; Sat, 29 Jun 2024 09:16:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719652661; bh=GOLUBPzTgputNw2p6NVFOL36H00EUUB7XUVOKSzwrm0=; h=In-Reply-To:References:Date:From:To:Cc:Subject:From; b=HxAN2/P09dvwcjKUcDgb6coB0WsgwFiguqfgnUyzsV6/WS3T1iHzpqrJOuftLn0fR iSwCtx0+uicU19gczJW9myU1iXePbi7O5eOqcw+u/Z8WozGDP1F8BQ7CMwWIpVS0IQ X44jrH8Eyj6FXz6eRDBGLf/nEUYQ6DLMjm6K9kqQTExqBrxk2Co4JQNW38qG27g7Ux JredVVPvaC5z6NJ14JrjKZzr1qwdCg26NwtPCTitGuqA1yZgX9ZRgng8K24i16QnEe 2iTT7gbLBkYpAoJ6ZZuZsW/ssovmYn7OwHqLuTisI1EZpXzjj3RXTahKp/Vd8E6iQk RvSXotKbdFqvA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A9503180AC9 for ; Sat, 29 Jun 2024 09:17:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fout2-smtp.messagingengine.com (fout2-smtp.messagingengine.com [103.168.172.145]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 29 Jun 2024 09:17:35 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id 733EA13804DA; Sat, 29 Jun 2024 05:16:16 -0400 (EDT) Received: from imap49 ([10.202.2.99]) by compute1.internal (MEProxy); Sat, 29 Jun 2024 05:16:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1719652576; x= 1719738976; bh=T7FKTrHhRYI4jyJiUeIRutCZ+mEr3HBmKw6wYtY81zo=; b=U bilHQsQrNFd1swdJs22LvK4DC4WmPoLVhbfW0hdWBA8ORTPOLVgkmrb2uuGbzFrb eEJXmEJAlRekQfYKDTQkVQEuwO0Bkm7CVcaz7dN20h2mksImKYvy+DuNc3RTcK0j ZHOGvkJOhQGZvr/RNTiFDzm3f1nWspgPYyxPnGdU1pSmerUvJNr+QSvURIq0DVfY O5TBUEhS+D0b3JhlZd/ieOy9+/Thi3n4CJODcrwYK5YfRoVxSBf+veht/5cR05VF Eui/QKGx6b8iIhtBseQ5eJDNvDbs4VsUWObPqJCczwRxecqYY1cQXQd3k/YyKvJE tOC+UoiwOHESgEihTdkyQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1719652576; x=1719738976; bh=T7FKTrHhRYI4jyJiUeIRutCZ+mEr 3HBmKw6wYtY81zo=; b=q9gnSGt4hRoDoF6CqUXA9nm702f+/OBjFL7rWwXttsvs RUy8RCZdXaD4QYkBNfm/ULkSa88kuUHQOoK7Q3BHb4dHPU4/eALarAXyGPLFocfu 9US+RVThN16/3gW/oa5Yt24I2OlHncNTRbrln452gJId1Nm2W1jIJg0X63iHEXV1 JbTvWOrIwg+sUg9VOLHLV7DNGxe9TdpvteSeUhwgm6oeKWh1mqGb9hENoHWO39Ak 0VHKCL7S9PZ5ikfy9eEjNnFKYN9N2R1pai0jgM25UZFbxhCwvWWjOj+ZM06CKSNX Bh+cuvWAmU7OnphdKvVSGLCE8rmiHPVFQITAzppoSw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrtdelgddufecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesrgdtreerreertdenucfhrhhomhepfdftohgs ucfnrghnuggvrhhsfdcuoehrohgssegsohhtthhlvggurdgtohguvghsqeenucggtffrrg htthgvrhhnpeeutdetuddthfetfeffieelhffhkefhvddtheegvddvkeelieeuffefheet vdduleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hrohgssegsohhtthhlvggurdgtohguvghs X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 1EB5E15A0092; Sat, 29 Jun 2024 05:16:16 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-538-g1508afaa2-fm-20240616.001-g1508afaa Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Message-ID: <90dd3eb6-c7be-4951-a6b6-fd3785ed92e5@app.fastmail.com> In-Reply-To: References: <8dc5393e-b552-465a-9237-9251e8bf1001@app.fastmail.com> Date: Sat, 29 Jun 2024 11:15:54 +0200 To: "Jordan LeDoux" Cc: internals@lists.php.net Subject: Re: [PHP-DEV] [RFC] Operator Overrides -- Lite Edition Content-Type: multipart/alternative; boundary=68f3e3d208bb420f8e33c7465dd9e9f5 From: rob@bottled.codes ("Rob Landers") --68f3e3d208bb420f8e33c7465dd9e9f5 Content-Type: text/plain On Sat, Jun 29, 2024, at 02:13, Jordan LeDoux wrote: >>> 4. The `static` distinction is also fairly meaningless, as in PHP there is no situation possible where an operator overload can occur WITHOUT it operating on objects themselves. >> >> For this, that is the wrong approach. The actual behavior is on the type, not the instance. The object instances may not even know their value, they merely represent the value. > > A GMP object instance that does not know its value? What are you even talking about? Can you show me some code explaining what you mean? I had literally months of this argument for the operator overloads RFC, and studied the overload implementations in six other languages as part of writing that RFC, I feel like I understand this topic fairly well. But I do not understand what you are saying here. A few minutes ago, I sent an email where I accidentally made the code non-static, and I think I see the merit in what you are saying. It felt so natural to use $this that I didn't even realize I was doing it wrong. So, looking at your RFC and mine, I think this can be improved. What would you suggest it look like and then we can work backwards from there? --68f3e3d208bb420f8e33c7465dd9e9f5 Content-Type: text/html Content-Transfer-Encoding: quoted-printable

=
On Sat, Jun 29, 2024, at 02:13, Jordan LeDoux wrote:
<= /div>
4. The `static` distinction is also fairly meaningless, = as in PHP there is no situation possible where an operator overload can = occur WITHOUT it operating on objects themselves.
<= /blockquote>

For this, that is the wrong approach. Th= e actual behavior is on the type, not the instance. The object instances= may not even know their value, they merely represent the value.

A GMP object instance tha= t does not know its value? What are you even talking about? Can you show= me some code explaining what you mean? I had literally months of this a= rgument for the operator overloads RFC, and studied the overload impleme= ntations in six other languages as part of writing that RFC, I feel like= I understand this topic fairly well. But I do not understand what you a= re saying here.

A = few minutes ago, I sent an email where I accidentally made the code non-= static, and I think I see the merit in what you are saying. It felt so n= atural to use $this that I didn't even realize I was doing it wrong.
=

So, looking at your RFC and mine, I think this= can be improved.

What would you suggest it= look like and then we can work backwards from there?
--68f3e3d208bb420f8e33c7465dd9e9f5--