Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93020 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37678 invoked from network); 1 May 2016 14:39:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 May 2016 14:39:26 -0000 Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 209.85.161.174 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 209.85.161.174 mail-yw0-f174.google.com Received: from [209.85.161.174] ([209.85.161.174:35081] helo=mail-yw0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3C/63-03860-D1516275 for ; Sun, 01 May 2016 10:39:25 -0400 Received: by mail-yw0-f174.google.com with SMTP id g133so211750715ywb.2 for ; Sun, 01 May 2016 07:39:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=yt85Yk3hxxsL7/euL1RJ1R6J0oUDMmMRzsf+s9REW2k=; b=Hv9FnsELlP8UsCN4PxCogWdrLYKsxOrl5As9RXOtC3vJY+TwOXedzLRtEic2wLM1fl EIXvaDDRkAhETeVUzJmqhQ57/w+ZoDiNVdoj3R15jbwHBpuV+QDjNT274IiCf27fpk0L a3iDDZ0lQ0susZPiDYU0iBcdzGe7DwB2ksjGBtKKH3U6g/zY6uYIs4vizF6yTzNJ00a2 nc5v9jzHqOburAcZf67LvjiRfKNSOIAl586u0J9DUEDUNB/5B3yn7pO/E4ojrrFl3DRp BeslGYWYGlWt94v+F34ReTv4JOCag7KolncQmeR88dXTP1xzSEBH2uAZVWmcHasMtIzJ Ibzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=yt85Yk3hxxsL7/euL1RJ1R6J0oUDMmMRzsf+s9REW2k=; b=RkvD6OFbbgFgwzS1UvAHvo5o1eWezy8GfRD+lFsPWF8fg30uD9O8ZX8SIswXtwnrHV QLAqTUTrIePVec4EbfDlLEXiaZrtlUkWwP9dLUDwPK/HDknlLZ9D8qjKZnBScRF6KwQ+ EWVnUcoeRrkLb5MQ9X4FLiTkEPTZc6zrdcOYQOhOlhvS5LU+z3Sgm3a2kbHp7risiY21 miS6vk0e5XeKk6I0DCsCrIZwcPls4q3W9Q0pKAJb/02HHxX6QBp5DPU5VhjP/Jv+y96L zRCKKyJwtmxn9TPiq4HNCPsNSbMEqHKVYuNc8/XpDvZ2deuUqf6uXn3J7URbaYDTUsWV Dqgw== X-Gm-Message-State: AOPr4FVPq6aVjYeBbRtqeeOoxsp0m25uka8XlX2uPO2qyAp62kboxonw2bH7ftrNe71kSmYBo5nsrhGMHkrU4A== MIME-Version: 1.0 X-Received: by 10.13.231.5 with SMTP id q5mr4293290ywe.6.1462113561998; Sun, 01 May 2016 07:39:21 -0700 (PDT) Received: by 10.37.91.10 with HTTP; Sun, 1 May 2016 07:39:21 -0700 (PDT) X-Originating-IP: [2.99.239.93] In-Reply-To: References: <8ea990da-1fe7-256c-4e08-0b30715c8e8a@gmail.com> Date: Sun, 1 May 2016 15:39:21 +0100 Message-ID: To: Marco Pivetta Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Pipe Operator From: danack@basereality.com (Dan Ackroyd) On 30 April 2016 at 07:49, Marco Pivetta wrote: > Here's the pseudo-code for a typical request/response dispatch cycle: Hi Marco, Could you clarify something for me? If I submitted a pull-request to you, with variables named like this: $v = buildRequest(); $v = validate($v); $v = convertToCommand($v); $v = execute($v); $v = convertToViewModel($v); $v = render($v); $v = convertToHttpResponse($v); emit($v); There is no chance that you would accept it. You would (correctly) observe that the variables for the intermediate steps have meaningless names and so the code is hard to reason about. I don't think removing the presence of the intermediate variables and replacing them with $$ improves this situation. What is it that having a special pipe operator that make this acceptable, other than it covers up the lack of names for the intermediate variables, by using a different syntax? Marco wrote: > Relevant: https://youtu.be/UvD1VjRvGIk I could imagine how having inline branches could be a useful thing for functional programming, for various scenarios, including being able to 'inline' error handling, to be nearer the source of errors. However this RFC does not propose that. cheers Dan