Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104675 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 72712 invoked from network); 12 Mar 2019 17:23:00 -0000 Received: from unknown (HELO mail-oi1-f178.google.com) (209.85.167.178) by pb1.pair.com with SMTP; 12 Mar 2019 17:23:00 -0000 Received: by mail-oi1-f178.google.com with SMTP id j10so2131878oij.13 for ; Tue, 12 Mar 2019 07:12:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SDvOliAkkXt4kYq4BWWYENNFLnOXc+3UyRo4kyj7pNc=; b=UJRXgux06aQWkStCTdbhNJ6BXqhdGbTfosQ8W6WV4K+wR2Tr8rzkBLuBz18RJMoj7i ByBKNBc6WupUYxS9T9sw5i9BkQyl21jBeOKf8ghEeO+XiDj7ncmaVfyymZI0IhHv5yBu quru1tq9MDdS6d4oaBvU0u0SwTpZae8uPQ2tlVigheL+dkMxgPMl77WbZTKQTdLpbBYs KXnDsZzfD9mT3Uifx+g85yx5PzTglt1NZ/wsBQs+ZYrkHNhfBQAXSsDhiVk3T+q8Fv0A VMvUKkpOgNH6JqwpD5dan/ZFYFbH3YRiPxTQmZlVkxez6UYkHxzlNMZkffwSYsvfndOM GtzA== X-Gm-Message-State: APjAAAUBhO/iif5lIuRr5qgkoB3abN8MZC8GK0TSYxPLDJO8G7egbfeN b+8U/2MbdQippibwHkjup2+gd7t5X5Zd203IqP4= X-Google-Smtp-Source: APXvYqx07b0LTYVvFRwhtEc1L0fQTSfZ9p2QJD/CbMpnCLDX7NnKZ4vrBR8SOSN3MosT6gviuhZmpdAarIpoNOwCUeU= X-Received: by 2002:aca:af01:: with SMTP id y1mr1883507oie.140.1552399974408; Tue, 12 Mar 2019 07:12:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 12 Mar 2019 16:12:43 +0200 Message-ID: To: Chase Peeler Cc: Larry Garfield , Internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] RFC Draft: Comprehensions From: kalle@php.net (Kalle Sommer Nielsen) Hi Den tir. 12. mar. 2019 kl. 15.49 skrev Chase Peeler : > Everything looks weird and "non-phpish" when it's new. OO constructs weren't PHP-ish at first, because PHP didn't originally support OO. Imagine "foreach" didn't exist in PHP and we were still using while(list($key,$value) = each($arr)) syntax. > > I agree that some of the examples are a bit hard to read and understand - but that's only because we haven't been exposed to them. What I mean here is that the lack of things like the parentheses makes the code generally harder to read, imagine this for large comprehensions as userland would certainly do things like that and you end up with monstrosities of code that is less verbose than the counter examples given in the RFC. I mean sure I could just rewrite a comprehension with a lot of whitespace, but it kinda seem to defeat the purpose of short circuited generators and I might as well just write it the more verbose way. I like the idea, just not the syntax because it has the potential (along with short closures) to be annoying to read in the long run. -- regards, Kalle Sommer Nielsen kalle@php.net