Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104827 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 63299 invoked from network); 20 Mar 2019 17:09:22 -0000 Received: from unknown (HELO out5-smtp.messagingengine.com) (66.111.4.29) by pb1.pair.com with SMTP; 20 Mar 2019 17:09:22 -0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id B7B4322E6F for ; Wed, 20 Mar 2019 10:01:16 -0400 (EDT) Received: from imap26 ([10.202.2.76]) by compute7.internal (MEProxy); Wed, 20 Mar 2019 10:01:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=p+wXEQ WsC4qVUqGyAAe+HWfW3i/LfEHQnoqOBV0Alq8=; b=D9WNGIeJULzptirqihy1JL +tFw0NGE22o3AKtQV7NrlFhsILhdAqdMy6UXoQlmYJHpdcizpzbGvXZ9OUoTdDsl y74O0f5P7ZaFB+TKHSvfGwNdNGF1SURrl0ZFYi+pk+zaoN15LiAucYZl/2pN0ooT oJZVQNFZe72BKZTzKYKG5uNVUPMAOIDxZwOtzPxnZ+8hGzAwP38DEs1lgqrpt7mY 3xB0nn+TCpuqjaSZzvF4+CoCmhi3pCrgEiE5XFzOEjuRwvG6hXgdhuqPYVTjTAEl h1p+nqgJCJ3hmS4gJblj3jaJIUXerXeYlOT45rkb139AdXlWaQW4PEw9nnHFdK3g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrieeigdehlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvffutgesthdtre dtreertdenucfhrhhomhepfdfnrghrrhihucfirghrfhhivghlugdfuceolhgrrhhrhies ghgrrhhfihgvlhguthgvtghhrdgtohhmqeenucffohhmrghinhepmhgvughiuhhmrdgtoh hmnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggt hhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 51C52B422D; Wed, 20 Mar 2019 10:01:16 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.5-976-g376b1f3-fmstable-20190314v3 Mime-Version: 1.0 X-Me-Personality: 10727885 Message-ID: <2fcc58f5-6776-4434-85e5-86222de71300@www.fastmail.com> In-Reply-To: References: Date: Wed, 20 Mar 2019 10:01:15 -0400 To: internals@lists.php.net Content-Type: text/plain Subject: Re: [PHP-DEV] RFC Draft: Comprehensions From: larry@garfieldtech.com ("Larry Garfield") On Tue, Mar 19, 2019, at 3:25 PM, Levi Morrison wrote: > Today in the Dart world, Bob Nystrom published an article called > [Making Dart a Better Language for UI][1]. I think it's an incredibly > relevant article, since it is essentially about comprehensions, why > they are a thing, as well as some of the design choices they made. > > I think everyone in this thread ought to spend the 10-15 minutes reading it. > > [1]: > https://medium.com/dartlang/making-dart-a-better-language-for-ui-f1ccaf9f546c I love that explanation, and the solution they come up with sounds very elegant. There's only two caveats to it: * Something along those lines in PHP would be even more work, and again I'm still looking for someone who can implement the design here; without a volunteer for that, this discussion is all hypothetical. :-( * It doesn't seem like it would address the generator/iterator side, which is what my main target is. Splatting an array into another array sounds highly useful, but the style there wouldn't (as far as I can tell) offer any solution for the lazy-evaluation case which, as Rowan just pointed out later in the thread, is still highly important and impossible to get from a greedy-evaluation construct. --Larry Garfield