Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126841 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 7FB321A00BC for ; Wed, 19 Mar 2025 13:48:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1742391940; bh=ycOe/Nvcrdv8cT9ajuKstp/6W8EZ4Umlp8faS0yUEAE=; h=Date:From:To:Subject:In-Reply-To:References:From; b=XIVzAIw9WcHvgofSCzTZrs6Ou5cZKIF5uyIH5IJsyE68lajEghZY5hQ/Im4wZpnr/ crizOqrDAq419FRTxYfsPBwwRjbp3TPIJJ7dhWMLLO8m+0XHkDxRtCKjv9+ONNV4u5 OfO/loB3//W8t7uvmmo7wKAqoCz0UHMNncXNsmTwKFiXj1O2eiy9hfcBZrP/c2uGsW Lt4z0zqWXk21T07t+3a9P8lLg0tCIjXMnA2MOFSkyRXuHzFbwql7wA5xW4Ur1P6W9A 6Vohn9blpkwulQ+cTlCVpkBjKdcMluNZx/tdgB03NMVSg49HH2JIag2eGCNJ3lvMcv eqBc22OBjVz7A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1C2E4180053 for ; Wed, 19 Mar 2025 13:45:39 +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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-a3-smtp.messagingengine.com (fhigh-a3-smtp.messagingengine.com [103.168.172.154]) (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 ; Wed, 19 Mar 2025 13:45:38 +0000 (UTC) Received: from phl-compute-13.internal (phl-compute-13.phl.internal [10.202.2.53]) by mailfhigh.phl.internal (Postfix) with ESMTP id 8293C114024E for ; Wed, 19 Mar 2025 09:48:09 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-13.internal (MEProxy); Wed, 19 Mar 2025 09:48:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding: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=fm1; t=1742392089; x=1742478489; bh=8V9E0wZboI33L0TalLZdu2ygifhdI9LneJaijXRX3LE=; b= dmi3UFNj0bxsmbDBUS97Ay9Pfo+HCe6lY4U07VDcKwStyW8eeKjPiilDaDXNBt8D 6A+9+3zDQSvsYQ71wE5iFCnsXz/4XGXrAzGb0sdGezAiHhogKrS1EhEhX7TRoapK o9tZcq7v1B/U0BxvpxTBBW4u3cmaRymveMIvQqz/ZGa5a0+dZxCTRMXWzvmC/wp6 tavBtIYMZFMGGT8a+ExBAsjt4Qb+3HIrVqRz6tGbPjN5QA2C6Wahp/1Eubvboewu Qui1yT9V6fvD8YcP7dKr4yX6mP506iHsUxFdXmSLUncEITcAs1ZOzNdxuCwbPKOT zUIrdcIjH8iarTzP9Nibnw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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-sender :x-me-sender:x-sasl-enc; s=fm1; t=1742392089; x=1742478489; bh=8 V9E0wZboI33L0TalLZdu2ygifhdI9LneJaijXRX3LE=; b=XSNU+P8EupnwAnOdX Vun4mLfWPexx2shsFqz69JxsI48dBCuh3QudEI+szU7v5AUjAb5ZP41oPuTrGkKI UgqxwVqp9IgnUwyvqaK7sGPmPJsBiy/xWSS3fjV4+6cw9QH9V6q1cVPvQXud5/8R vX4ehotR39PhVzCBgHUp+pHCsk+bId9QRh6B+ZwbxZ5jsU61gEqVsGzBmI/DNsnk d1uISRSHjAvfGE/Pp88FnF0zTecwfjZjNVsuDtaA+z+fJg86CneYAGy/+t+aGHri ZpZdENDOn1dP4JQm4H7JaaWFHVXrARvf+6miwbjHnqU66wA8KY8r3XXcI5yAZpiI dlLMA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddugeehgeelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhf fvufgfjghfkfggtgfgsehtqhhmtddtreejnecuhfhrohhmpedftfhofigrnhcuvfhomhhm ihhnshculgfkoffuohfrngdfuceoihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqe enucggtffrrghtthgvrhhnpeehleffteeigfevudetfedugedtudevledugeeugeelheei hfehgfdtkeevvefgleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehimhhsohhprdhphhhpsehrfigvtgdrtghordhukhdpnhgspghrtghpthht ohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslh hishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 19 Mar 2025 09:48:08 -0400 (EDT) Date: Wed, 19 Mar 2025 13:43:56 +0000 To: internals@lists.php.net Subject: Re: [PHP-DEV] PHP True Async RFC - Stage 2 User-Agent: K-9 Mail for Android In-Reply-To: References: <72bd5401-53a9-409f-ad45-687333401961@rwec.co.uk> Message-ID: <6987D912-CE46-4145-A8CE-732CA590A522@rwec.co.uk> Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 19 March 2025 11:27:11 GMT, Edmond Dantes wro= te: >> >> You're cheating again - you've put an extra pair of brackets around one >> expression and not the other, and assumed they'll work differently, but >that's >> not the grammar you proposed=2E >> > >Why am I cheating? "Cheating" in the sense that you wrote out a "general syntax", and then dr= opped in examples that contradicted that syntax=2E Saying "it follows this = grammar, except when it doesn't" isn't very enlightening=2E >> spawn (getClosure()); >This is an honest statement, provided that the second parentheses are >optional=2E The full notation would be: >> spawn (getClosure())(); That's not the problem; the problem is that the following are all equivale= nt expressions: foo() (foo()) ((foo())) (((foo()))) But you want these to mean different things:=20 spawn foo(); spawn (foo()); I think that would be achievable with a new grammar rule for "expression o= ther than function call", so you could have:=20 spawn_statement: 'spawn' function_call { compile_function_spawn } | 'spawn' expression_not_function_call { compile_closure_spawn } But from a user's point of view, I hate rules like that which mean subtle = changes completely change the meaning of the code, in a very specific conte= xt=2E >The reverse meaning is that if `spawn` is not followed by the `function` >keyword, then it must be a valid expression that can be enclosed in >parentheses=2E > >There are some doubts about whether all situations are correct, but so fa= r, >this is how it works for me: All of these are examples of the keyword being followed by *a function cal= l*, not *any expression*=2E Which honestly I think is the right way to go= =2E The "expression" part came into the conversation because I think it's weir= d to force the user to write "function() { =2E=2E=2E }" as though it's a Cl= osure declaration, but not let them perform obvious refactoring like moving= that declaration into a variable=2E=20 If it's going to be a special case for an "inline coroutine", just use a k= eyword other than "function", so it doesn't look like an expression when it= 's not, like "spawn block { =2E=2E=2E }"; or no keyword at all, just "spawn= { =2E=2E=2E }" Rowan Tommins [IMSoP]