Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104640 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 28067 invoked from network); 11 Mar 2019 01:48:45 -0000 Received: from unknown (HELO mail-qt1-f178.google.com) (209.85.160.178) by pb1.pair.com with SMTP; 11 Mar 2019 01:48:45 -0000 Received: by mail-qt1-f178.google.com with SMTP id f11so3106490qti.7 for ; Sun, 10 Mar 2019 15:38:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YBgdHKCaqgImhzXaY/+nXtoe1TFiygCmgGX9N1oNIs4=; b=KkmlRB5BlOEJSWfvOH+OoET/uKrrpBRQUyTrdoHCBZ6PfCWLZ+9WdojfKiEstToU23 8/DYbiWmm95Jgc+x9LzlAeQkTCtRg+xNATW6e4hSJClelSjfvmOQ7Awvf/qP/C9IFUfb gtXNWM8MI3lcfkeZbaWeftinbQwqjtlXN5OUXr9XrYFvIfnaYL+2gGlN4uO5PzDKkAJ/ dBhVi1htiIDlpUILYazvo8WuztAuIdUzypw+GI8Js624LL362l++1CUiqrlAkJUTN1Tq XS2FM8ouQOUPSqSOgzJcdB1qGw6yoePA2SdEI/L8V9x1bPoDLsOFPvhY7jBX2t+Hksuk wcDg== 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=YBgdHKCaqgImhzXaY/+nXtoe1TFiygCmgGX9N1oNIs4=; b=sndM/5cM9APVqjwnEaIuWUW8HZ5okNr7UYZYRg0GYhLcHF7TfArl4F4AQWE1nx2PzH T9P0UWv7oLzcuosSRuF2z6nLFTBTM/pfjMnIk8E9T8MR3chiypFH0hd34kk5Fvhpr/P5 r1siApaVVsROdFIwaF1tfw59e84/qbCeJmhO7ttdsg1HQve4jd1xsWl1lXqw6/BRjL/n SNQ9F0e+fGh8z1pg69xcwsSd2c6GHvQkmYVKtHsT7SW0ZJMJB3AifsfLyaD7Yt4YncNS 8MgmDDp5cLat8ZWNwISm0VtEHiTn0T0/r96x+vUCwS+8CH87tY9Rdf6k7Xr8l4ovq4fJ dgNw== X-Gm-Message-State: APjAAAWnzamRm6/o036BtJ28w1k0GHbpMhsf8Pxt2EoKJKPK+xBsddG3 UH96JwFDwyKe3gF3G1jYvQFffYrlPGsFzZgrRlR2us17 X-Google-Smtp-Source: APXvYqzTo6axMH/KGn+0wiLfr/z/Arm+49v3BCqCYB4zjcE/np0Sx+0yHlsK7rjC2EJmni+iuo9JXpJnjooaV9inLDA= X-Received: by 2002:ac8:1497:: with SMTP id l23mr23191948qtj.296.1552257494693; Sun, 10 Mar 2019 15:38:14 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sun, 10 Mar 2019 23:41:46 +0100 Message-ID: To: Larry Garfield Cc: PHP Internals Content-Type: multipart/alternative; boundary="000000000000923be60583c51caf" Subject: Re: [PHP-DEV] RFC Draft: Comprehensions From: netmo.php@gmail.com (Wes) --000000000000923be60583c51caf Content-Type: text/plain; charset="UTF-8" Hi! proposed syntax: > $gen = [for $list as $x if $x % 2 yield $x*2]; > current php + short closures: $gen = () => foreach($list as $x) if($x % 2) yield $x * 2; 1- parentheses could be optional around control structures, so `if(true){}` could be simply `if true{}` 2- "for" could accept the syntax of "foreach" 3- we need short closures --000000000000923be60583c51caf--