Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116628 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 42648 invoked from network); 12 Dec 2021 17:55:16 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Dec 2021 17:55:16 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 231071804B5 for ; Sun, 12 Dec 2021 10:56:47 -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.5 required=5.0 tests=BAYES_05,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-f46.google.com (mail-ua1-f46.google.com [209.85.222.46]) (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:56:46 -0800 (PST) Received: by mail-ua1-f46.google.com with SMTP id w23so25694896uao.5 for ; Sun, 12 Dec 2021 10:56:46 -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:content-transfer-encoding; bh=EWnLZ6c/H1sXZSvQ301g3wT4uG2LX1R+6wRDMH8mJYM=; b=4tE9yBDIYB/6w2rYUJJyxMblnFHE4bZe4Qd1PNo0S+hK7A9xSYtW8YSNHW9l8m+a/D rJWXdVEMIF4cEGLZbuKtKXOOpRlua3YiJCo9Td1wmRd1ngYpge36MkD3LaJ+PYpU50lk RM6cCpbnLMM2eL6g8pq8XJC8A7EtJWCH1VYmVIrTe8zbm/WjRXtJGZ1uWIK14pkq/kNC c86aRY3BnhdKLWVBl19jxembowBKZg8q2ifdq2+DuAiytjvhgcnyVlarMANYgQ+5X/1Q 5c9NLHViy8TJchTBJAUdIYFSyDDeepoErYxFjeK4M4R5GY1eba1jgmUWf6gafe0O/K/P Qilw== 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:content-transfer-encoding; bh=EWnLZ6c/H1sXZSvQ301g3wT4uG2LX1R+6wRDMH8mJYM=; b=b9c8KQRQGsWD+qy6IwBV1oYUtY0l51tvIv+WOli0DBm5VAFPHoE16BdJVDCNPcnvhc 8jIATkeUbxCnTdEEFxI6108N6QVoCk9AHY92n3WXprYTEV7gigoTD7fGEeOSYlLcRbUL Ms+QSypDWwsvIUvGq0uz6cpNUQihYJ5hfEj3+/ZO99nJUTubpajUt/16T/EQKXhRPa1e tMjZ1y2a8FdQCK6SntOASF9imh8RbLHPqu2kemoCIQZUqv5DttjxWac3kyL4QPiX7xX4 nWnr1W5jt3jCUpObMNG/rUaJ1D5vU3/Kf83kDli1RT0NSDXHwfx/U+fgR4uP+UErdN5U x/vQ== X-Gm-Message-State: AOAM533pbX1Wwob+CMu9MAB93tobx3d0cWDPDSx0nmAo1vN+6qgp5TG9 WJev5mpK4iAxmplXoRrFwrow1GXhIcWkFL9L12N2L5PIIip2Hg== X-Google-Smtp-Source: ABdhPJyuwMf70XpoHon0hFeBtCncTapTzHriKl0nfpWcpQuPjH5fcRo2BUGMVDW4G7jWyYnOyoHPukzlKsu4izbGOr8= X-Received: by 2002:ab0:1566:: with SMTP id p35mr38371160uae.20.1639335405712; Sun, 12 Dec 2021 10:56:45 -0800 (PST) MIME-Version: 1.0 References: <7126a5cb-fdaf-4e50-b8af-7d95965d1125@www.fastmail.com> In-Reply-To: <7126a5cb-fdaf-4e50-b8af-7d95965d1125@www.fastmail.com> Date: Sun, 12 Dec 2021 18:56:32 +0000 Message-ID: To: Larry Garfield Cc: php internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] User Defined Operator Overloads (v0.6) From: Danack@basereality.com (Dan Ackroyd) On Sat, 11 Dec 2021 at 17:46, Larry Garfield wrote= : > > Using symbols, however, would (with some future extension to make it exte= nsible) allow for: I don't get how it's easier, other than being able to skip naming the symbol name. e.g. adding union and intersection operators function __union(...){} function __intersection(...){} vs operator =E2=88=AA(...){} operator =E2=88=A9(...){} In fact, I find one of those quite a bit easier to read... Larry Garfield wrote: > It uses effectively the same operator sigil, though. Yes, that's what I was trying to say. Danack wrote: > The name of the function (e.g. __add) always refers to the symbol used > where it is used, not what it is doing. If the naming is taken from the sigil, then it's always appropriate. So if operator * has the magic method __asterisk instead of __mul, it avoids any suggestion of what the operation actually means for the object. btw, I don't really care about this naming problem. My concern is that it's being used as a reason for introducing a special new type function, when it's really not a big enough problem to deserve making the language have special new syntax. cheers Dan Ack