Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122523 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 0BC301AD8F6 for ; Tue, 27 Feb 2024 20:23:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1709065439; bh=nnSMvzunO/WwQUmN6noHMhvXukQas0feBHJ7phbscAs=; h=In-Reply-To:References:Date:From:To:Subject:From; b=YuXIZeZLILWxx18eNpqRkG9DFRulUy0SgCZAK6b+cpFmm7RWDqaSgjbYfdxt9z0Z/ 9b5NaKZ3shmSLcj7LoMOqajYPW7F4gWs4FcU8AXNkQTrmjYRQmMfuojbqlUV+ahEHg qiHA2R/6kz8O+XQ7mw+1rHCQ5HigxKOvVuCmgpcfSjrHqYe9Mhx3rQQAHf7N15uXma bQBgUAMXdp8xGbBRZJh/QorwmhIG1Tj30yQGj2u7KZVpl05dNne6MkjeshKEAmFCcL czpIkyB1UeLk/R2A4TQl8CMimOffa2g8MqgzT0pc708YaYA3m0MxlAgHk5M4AbwTE/ 1MBguBvHe2zLg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AEC081818B5 for ; Tue, 27 Feb 2024 20:23:57 +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,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 fhigh2-smtp.messagingengine.com (fhigh2-smtp.messagingengine.com [103.168.172.153]) (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 ; Tue, 27 Feb 2024 20:23:57 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 73C1311400E7; Tue, 27 Feb 2024 15:23:48 -0500 (EST) Received: from imap46 ([10.202.2.96]) by compute1.internal (MEProxy); Tue, 27 Feb 2024 15:23:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=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=fm2; t=1709065428; x=1709151828; bh=Q9vuESDgKH mQszfneLFcC12DhO9hYwG9Iu9yg8SxOF0=; b=NdTICBtKxDbaz1DP+eWzNhnzHK c2qX5MD1ehCg6sLBMMauoQAQaetB+bt/p9CsWsHb7rZie1N6VB2rIIvo8H03dVVQ O6RC51GzBW9Qhnc11bFJQ44Dj+Awoqty+IcG/zv3WkeNTRBfkmwLJivl/MXZAefx 279FJewzKOOX6TvOMNjoxILFMzxxXubZ2e2DxDn6UfT3MQcONdiHbXmbmGGc3mmZ 8mtPOd6cfyl8FSHfmZpDI1TBJMtSgT5qZ/jMVKQddXL1ABF7t+AlxTuF/ZUR0cXr sxJLOcvKtLXb24Vc9m9FZZhAOuLhdmzYi/AQdVyXTW5+USHoFKTEKGWjDnAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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= fm1; t=1709065428; x=1709151828; bh=Q9vuESDgKHmQszfneLFcC12DhO9h YwG9Iu9yg8SxOF0=; b=qkoVn6CLLHNPbhLopFO+WRPhkhK2spkjXIH0C9Zj5kM8 d57+Qlz/nGjduJGxrz5fyNc8bhdjlRSBHQu028mpqu4CYaYyxdH9Y1pnZ6ns/+ja KM1CTwogPBherGSsJ+XEO78KFhRSuKpCveG7Mngt26bWibDP92U1d6sGihdoGU20 u9D5wCDQsuc2UqDLnWkkHR2lLA2CETmUFjn+TCvN1cutb8RdzO8xxLafu36/dN75 MModSoLQelM+HgHyNY43nXl4N8Y7fowVPnwchAHbLzd5c4Pqm1yMWnESLv3Yyv2J 6kqyKJYwfyhxkavt+7TOHHsfy0+uCpMCTuG777RrDA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrgeehgdduudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesrgdtreerreerjeenucfhrhhomhepfdftohgs ucfnrghnuggvrhhsfdcuoehrohgssegsohhtthhlvggurdgtohguvghsqeenucggtffrrg htthgvrhhnpeeffeduhfduudeikeekudfghfdugfeljefgkeeghfdvieekledvvdejheet geetgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hrohgssegsohhtthhlvggurdgtohguvghs X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 25B392A2008B; Tue, 27 Feb 2024 15:23:48 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-182-gaab6630818-fm-20240222.002-gaab66308 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Message-ID: In-Reply-To: References: <790b5b4e-f51b-4050-a12a-5fa903d0568f@app.fastmail.com> <52C6F501-8E23-42D7-8541-88A22AD79375@koalephant.com> <36e90d8d-d275-4ce9-9dd9-1e2422c6d3a9@app.fastmail.com> <2fdf1933-b51c-40cc-8d02-31899b96c71c@genkgo.nl> <95e93cb9-3ab0-4cf3-8ec5-83e74c9dd607@genkgo.nl> <876aff9f-3eae-4d2d-8e3f-30dfbbeed49c@rwec.co.uk> <963f5cc5-cdb1-4384-b519-5cb15640654e@genkgo.nl> <58B82A81-8A89-4F17-B982-7FC36404032E@rwec.co.uk> Date: Tue, 27 Feb 2024 21:23:26 +0100 To: "Larry Garfield" , "php internals" Subject: Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2 Content-Type: multipart/alternative; boundary=cbdc3d185cb640d0bfc5f48556a0e9d7 From: rob@bottled.codes ("Rob Landers") --cbdc3d185cb640d0bfc5f48556a0e9d7 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable On Tue, Feb 27, 2024, at 17:16, Larry Garfield wrote: > On Tue, Feb 27, 2024, at 10:01 AM, Frederik Bosch wrote: >=20 > > Hi Rowan, > > > > Our discussion sums up the pros and cons. Whether yield is=20 > > complicated/confusing or not, is maybe personal. The same applies to=20 > > getting $this->prop resulting in different calls. Larry has removed=20 > > $field from the RFC completely now, while I think it was a sensible=20 > > approach to read the current backing value. I think I have laid out=20 > > another alternative to writing with the yield/return suggestion. It'= s up=20 > > to the authors of the RFC to do something with it, or not. Thanks fo= r=20 > > taking the suggestion seriously. > > > > Regards, > > Frederik >=20 > Ilija and I have discussed this, and we both agree that yield is not a= viable option. There is no generator or generator-like behavior involv= ed in hooks at all, and a syntax that implies there is would be very mis= leading. And adjusting the code to make it actually generator-based wou= ld make the code considerably more complex, and most likely slower. If it makes the code more complex, then it probably shouldn't be there. = AFAIK saying there isn't generator-like behavior, I would disagree. The = value (in this case) is exactly like an iterator, and may have multiple = values through the function lifetime. A normal function only exposes one= value -- the return value -- unless it exports values out of its scope = using references. Only a generator exposes multiple values over the cour= se of its lifetime. > It figures that people would start speaking up in favor of $field righ= t *after* I removed it from the RFC text. :-P At the moment, we're comf= ortable either direction. (It hasn't been removed from the code yet.) = The main question is whether the trade-off of an implicit variable name = and the potential for confusion is outweighed by the clarity about what = is happening and where. It sounds like most people are just really, rea= lly pissed off by an implicit variable, but that's based on the as-usual= highly unscientific survey of "who replies to an email." I will probab= ly start a poll shortly to help get a better sense of what the actual vo= ting population thinks. I suspect that people who are for it might also happen to be Gmail users= . Also, I don't feel particularly strongly either way, nor am I a voter,= so I haven't said anything one way or the other. >=20 > --Larry Garfield >=20 =E2=80=94 Rob --cbdc3d185cb640d0bfc5f48556a0e9d7 Content-Type: text/html;charset=utf-8 Content-Transfer-Encoding: quoted-printable
On Tue, Feb 27,= 2024, at 17:16, Larry Garfield wrote:
On Tue, Feb 27, 2024, at 10:01 AM, Frederik = Bosch wrote:

> Hi Rowan,
&= gt;
> Our discussion sums up the pros and cons. Whether= yield is 
> complicated/confusing or not, is mayb= e personal. The same applies to 
> getting $this-&= gt;prop resulting in different calls. Larry has removed 
<= div>> $field from the RFC completely now, while I think it was a sens= ible 
> approach to read the current backing value= . I think I have laid out 
> another alternative t= o writing with the yield/return suggestion. It's up 
= > to the authors of the RFC to do something with it, or not. Thanks f= or 
> taking the suggestion seriously.
>
> Regards,
> Frederik

Ilija and I have discussed this, and we both agree = that yield is not a viable option.  There is no generator or genera= tor-like behavior involved in hooks at all, and a syntax that implies th= ere is would be very misleading.  And adjusting the code to make it= actually generator-based would make the code considerably more complex,= and most likely slower.

If it= makes the code more complex, then it probably shouldn't be there. AFAIK= saying there isn't generator-like behavior, I would disagree. The value= (in this case) is exactly like an iterator, and may have multiple value= s through the function lifetime. A normal function only exposes one valu= e -- the return value -- unless it exports values out of its scope using= references. Only a generator exposes multiple values over the course of= its lifetime.

It figures that people would start speaking up in favor o= f $field right *after* I removed it from the RFC text. :-P  At the = moment, we're comfortable either direction.  (It hasn't been remove= d from the code yet.)  The main question is whether the trade-off o= f an implicit variable name and the potential for confusion is outweighe= d by the clarity about what is happening and where.  It sounds like= most people are just really, really pissed off by an implicit variable,= but that's based on the as-usual highly unscientific survey of "who rep= lies to an email."  I will probably start a poll shortly to help ge= t a better sense of what the actual voting population thinks.
<= /blockquote>

I suspect that people who are for it mig= ht also happen to be Gmail users. Also, I don't feel particularly strong= ly either way, nor am I a voter, so I haven't said anything one way or t= he other.


--Larry Garfield


=E2=80=94 Rob
--cbdc3d185cb640d0bfc5f48556a0e9d7--