Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122658 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 03DBD1AD8F6 for ; Sat, 16 Mar 2024 15:38:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1710603515; bh=nanWg5xFMc3EX0jDl0akw24QYNq36bCIIezOqe3HiWU=; h=From:Subject:Date:References:Cc:In-Reply-To:To:From; b=XGGXNwqGWx1OlJZTUFBjMgbZH1xT8Vt+Otsms3JnadwS8aGNp432uB1Q75B2C8JxV +VI0abhoH7+bMRlMVn10ho+AHHE2RbXHXwYQtd+OQv5zamvYSxV4OQD4W1x5zNxLij 39e+FAO5tQu5mhA3xeZ/6JJPDUtBorGR2lkjzXRGPXBBSfWoa+grNfGpQMgz4W+MI3 6ZdkoNxdpz0UT/KVfumzqLWMa00NJnlCGvp//U838FwrRLDVN/hOESfZvSda8tOba3 6nYLllsNblNDs1kzj2vZ3BWfgAlBTOxKLGnCr0WZBHg0qdM+BAM0KBoG0rDeMDEpk0 D9VLMjffEzwBQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 79C9E180074 for ; Sat, 16 Mar 2024 15:38:31 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail.sakiot.com (mail.sakiot.com [160.16.227.216]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 16 Mar 2024 15:38:30 +0000 (UTC) Received: from smtpclient.apple (unknown [117.55.37.250]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.sakiot.com (Postfix) with ESMTPSA id 3D20E401E2; Sun, 17 Mar 2024 00:38:09 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1710603489; bh=nanWg5xFMc3EX0jDl0akw24QYNq36bCIIezOqe3HiWU=; h=From:Subject:Date:References:Cc:In-Reply-To:To:From; b=OYRW2k03Ml+yGzTnS+Zdc3i5VTwP+SOYrO98mrI2RwpcBlpVh4kSV6y1h6KmzUugL 3ATmim8SiQ8thK2AOYJCTbA3CL716BR6kQ7YAab07WYOPSmeguwU6OabuiDqHfsDdX bvHFMxky4FruJAQhmJxutsgovXqEDitwFTLOIOQY= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net Mime-Version: 1.0 (1.0) Subject: Re: [PHP-DEV] Supporting object types in BCMath Date: Sun, 17 Mar 2024 00:37:55 +0900 Message-ID: <09F87F91-6538-48D2-9E34-0296E02CCC1A@sakiot.com> References: Cc: internals@lists.php.net In-Reply-To: To: Barney Laurance X-Mailer: iPhone Mail (21D61) From: saki@sakiot.com (Saki Takamachi) Hi Barney, > I would suggest if you do this only supporting immutable objects, or at le= ast making immutable the default, the one with with the simpler name, and re= serving the mutable version specifically for when people want to use mutabil= ity. The strings used with bcmath today are effectively immutable. >=20 > It's hard to see why a number should be mutable though. Users of the class= can always wrap an immutable up it in a mutable object if they want. >=20 > If you do have both mutable and immutable it might be worth giving the met= hods separate names to make the distinction clearer - e.g. "add" for mutable= , "plus" for immutable, and maybe making the add method return void. Thanks, that's what I was starting to worry about too. It seems like a good i= dea to support only immutability, as you say earlier in your proposal. Regards. Saki=