Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110176 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 52212 invoked from network); 16 May 2020 13:36:40 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 May 2020 13:36:40 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 38CDE1804C2 for ; Sat, 16 May 2020 05:14:20 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 16 May 2020 05:14:19 -0700 (PDT) Received: by mail-io1-f47.google.com with SMTP id e18so5499256iog.9 for ; Sat, 16 May 2020 05:14:19 -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=16X5fKqt7Ef/XWO0GnNnvd8rtTNuzZRd+i6liJ8wnAA=; b=MkTat5QIGCqHzjccDefyefgxadSxCyDfcCGE1WjLttS9O5+99b5jhb/IVq85ZCx4gt MpIGOAt2rmsJYOSLCHdgZZW5q185sirHvcwq19IoKJjZmuJL5IWN7SD9o9qutJ8aHmd1 Of+p7vVm5ptht6bT+tVtlePZ86EG5Ols+K0TILxYGf3aypxYET7LXf5jqAgsCoaSzlO9 V5rl08Zes+1ojffiiVz2KaBXiO1g/JLK6fcOI+ed9aF/Ilxqug08ZWhanTYSzy4PHTr5 WJ52vdfL//BW3T6lJxYhFQNy+ZcYBgyQVaYvUTp34fMJyz4zA0lkkDNLK2rTpLtuJ8jz m6UQ== 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=16X5fKqt7Ef/XWO0GnNnvd8rtTNuzZRd+i6liJ8wnAA=; b=PaIdvqVl9AcQ0wXyCEar3Cap2MIy09/iwNhaqu1JQsV298Bq2WaWWLugULMyOuPT38 jeN9r3aYz+QsNvpruhVYTrRm+972kU2YnHcoMJu8PbPPXqNSeOzwPaM6kYkkaks/tt8d Mkn0vDERk1Mi3ldT9JUtna12KZOwYA+HkRRJJ9U/K/MQbPMNVFDN+jKOKclnZq7g9JQs HYsk6KbAF9XP6NHDMZkgOUSzA+e+OuByCVlgz6YO4DqoDdzFr3L512rMhjcaHk6gPly0 nsKXNRpvc3VZenwHr5vmdkK6Vmwlcsu9WgEDubryF/XNBceM75WybyUlM4KlYoz4kl8N U4pA== X-Gm-Message-State: AOAM532NrLMpklitUIRKmfXZz75yP1uCVp+/X8FoilbMgwbO+tEux9gU xgxjgLCysUExXPmZ8w0LIfHlqYLjvCYOkILnPXM= X-Google-Smtp-Source: ABdhPJysLkJIqQrq+k9pJBzTKUJ54RndFIQNJv/2nter0dvphd2QkVMkPXKGaJcE5SZW5InpF+FatMPvQ6SPcJZk54w= X-Received: by 2002:a5d:8d1a:: with SMTP id p26mr6888968ioj.131.1589631258457; Sat, 16 May 2020 05:14:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 16 May 2020 15:14:05 +0300 Message-ID: To: Pavel Patapau Cc: Internals Content-Type: multipart/alternative; boundary="0000000000007bfa5e05a5c2de58" Subject: Re: [PHP-DEV] [RFC] Guard statement From: maxsem.wiki@gmail.com (Max Semenik) --0000000000007bfa5e05a5c2de58 Content-Type: text/plain; charset="UTF-8" On Sat, May 16, 2020 at 12:14 PM Pavel Patapau wrote: > Hello everyone, > > I want to propose new syntax addition - guard statement, that executes > code only if expression equals false and must contain control-flow > changing code, and written a respective RFC Both your initial email and your RFC mention https://en.wikipedia.org/wiki/Guard_(computer_science) Note how no language mentioned in that article has this keyword, `guard`, or any special language construct, honestly. That's for a reason: the guard statement described in the article is a pattern, not a language construct. Also, consider that one can pronounce naturally "if foo [then] return bar" but "guard foo else return bar" doesn't make sense English. I would go further claim that in my opinion all current control structures in PHP are intuitively understandable to anyone familiar with programming but not the language. Can the same be said about `guard`? -- Best regards, Max Semenik --0000000000007bfa5e05a5c2de58--