From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 14444 invoked from network); 2 Jan 2021 19:14:30 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 2 Jan 2021 19:14:30 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1609614870; b=OwrTZUiymXxKtx2yNzmYXTmX9oN9IMpIIoY1qWzJExqm/nvnXhht+Se18ByeKjlKGipjxI9upI Et2obT/j0DbiUvQr0YtHVqR56tRBxsCp8cNgeaGDCFszatp4/jZKfE64zZ7jB63aiACTWnzaLY UDCshLVxf0IifsSESznMFstzs0m7rLTH4KNeCfzlmqliE1fiahymV+cboZ/hVrdxLWKpspLeUh /2TEvsF0jh9YGDVn3Qiijd+ipP3hy87HsBiQKZhpzpI3iEhS/gYC8zXGLCkrzn3GagDaw4uPtM 5p4R6e9umrgMzT/Q/gkjX/ye2622dNiXv4liEe2KWO0K4w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-oo1-f45.google.com) smtp.remote-ip=209.85.161.45; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1609614870; bh=zfDBMpg2rDPUAR4sxRuux+2/3GFw5ZGw1gp+6sFJQx8=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=H6EiN3iw8tAlNdJ4OK0OvaQ6MG9pJdJuSFZcpEZHFkMxBXsufGPQrjnWkmJBh/4jMW0GfXYuS5 er8OoUqG+VC9ediFy5nsOIOfW38u+bjrcE5PQpDRiBty1C1ugm3FbsgrxSh+VHfZF0fbu6fIBj 9dF0Rkp5iQN/+7FYiXYvgWytmW9bge7AOkMA4r32tJA1QP18hqW/ahIHj6sw/CbolkpWfbiB8e lLNu8thFXy7QgLCv0Q1oiJXZpb/5PkicNxdppf7O+BbK4NQ48qBN7+kby0BaLm1rGUV7UOdmH9 rTtXOoh4+YfB/QzM1bhyCi0fSIQ4AEvNgUFE74LpfAP7Qg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=DCGUnfHHZ2lQ7QSfZbBZoynUsh3jUagWJkuF8W6wrJI=; b=fhYbX8xRSUItUEEG9GfOgc216a dishsjPqAeTYg9yNJI1HZlt6CgMlvTAQTOhKgRzKMDHjplqrO1InAtwIc3FyHcVCnGiP3Wegnkdzf jS0RLziQTydcPR9Zxi1dJVMKGY9pbWKn76+WbsyednPNbQ5A6kgkQd0qOTjOJa76bJDu6e4NITGqc cW3cXS0yhuyVtdihy9uiluUGPn8ygG3puBd9gdElsgISad7xwNaGZTB7YTDRcZ9aFvb+mj0YKFajV q20FvH2uhdbjHC8+sIUQY1F0fzBSnBk5/9e3iQC91v7wdhWSuFhs5VbKXRxpqpg4f6+U0F1Hg0m+M 3FOHCz8w==; Received: from authenticated user by zero.zsh.org with local id 1kvmM7-000I2Z-AN; Sat, 02 Jan 2021 19:14:27 +0000 Authentication-Results: zsh.org; iprev=pass (mail-oo1-f45.google.com) smtp.remote-ip=209.85.161.45; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-oo1-f45.google.com ([209.85.161.45]:34588) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kvmLa-000Hfh-Ra; Sat, 02 Jan 2021 19:13:56 +0000 Received: by mail-oo1-f45.google.com with SMTP id x23so5401381oop.1 for ; Sat, 02 Jan 2021 11:13:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DCGUnfHHZ2lQ7QSfZbBZoynUsh3jUagWJkuF8W6wrJI=; b=vYVfcOyLOVoiMRejVJ2Njw54K+lcTTqIiT1lqm2jm4gI5des+Z3B0wj11MRrCwEelZ c40GNzuEROTQHLRT1xR/pJ5A/MerpxQbXqp2wVdqtBEIFba+/GqOHJDf82ePE3Bzyo12 Zu67HOR+j0/8iEkCoqck8f7Z4mP6wF+ghaEKtKvRyRYi5oQis/bYo3D9yOfxRGPxJLot ujDBSVDec4tsQ+bgbD/wCPtVls5c+fDzyb+WSUtMlK+U4hSwjjUvqcnbOdZPWFsskbk1 aTcl/vZm+svrZ1t/KG0yR1kVZ81yRuGzOySl4eiGfZV4py/CU1X1Pn72g02ts0kbc5ls wBMw== 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=DCGUnfHHZ2lQ7QSfZbBZoynUsh3jUagWJkuF8W6wrJI=; b=RGRN3e9N4xvVZ37zlOrATWi1tuudjJE7/Q9eFa5A5sPjEOH2RLmtYuyCuWHIw1SEFY jMg+fQfExBr9J6hLgNvo9s2Ab31QhNc4ql1OOCJ2Ic09+N/RFFFhhsE4sIpPuNOR3/AF /NfcpppBDGg+V0g+IBx6t90RFqXKTN2eWsRS/ZEDW/pNz0ZuUXEcXcLqb1NUgVhi4RpB ZYWVu5lz5Aa4/k1Ysz0grFqEUUQlkbv1gbQocL1kPcV3tdJ7b6k9ns0KE8skCKNP+h34 TyYeNiLTYevJ0m/Efq5xl/62l6x9Un9bOq8qzXdlMvrGNdSSXzSfFfdHmExYIT1PmVHp pkAQ== X-Gm-Message-State: AOAM530lf/qQ/WUDc97Iqo+8370/4Foea+7WjvwIDp7nvErjrkWuHx+D I9X2JmQywHIprPyfZdC5Et2LPhJiFq5aSZOo3te+pQ== X-Google-Smtp-Source: ABdhPJzV/4kEZxDhTVWivnYts9iXCYPWYhK144A3eeNfbJCpqn8yDMnDoYIh9K1fKy4VfNHs3QSCyJEx76yddfq2qNA= X-Received: by 2002:a4a:520f:: with SMTP id d15mr44527769oob.29.1609614833192; Sat, 02 Jan 2021 11:13:53 -0800 (PST) MIME-Version: 1.0 References: <565cd2e7-c999-5735-4089-a56870713432@eastlink.ca> <20210102153217.xkpqakxgh7ulikqr@chazelas.org> In-Reply-To: From: Bart Schaefer Date: Sat, 2 Jan 2021 11:13:42 -0800 Message-ID: Subject: Re: syntactic trivia To: Ray Andrews Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 26300 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: On Sat, Jan 2, 2021 at 10:04 AM Ray Andrews wrote: > > Sure, I just prefer the visual cleanness of my way: > > [ true ] && do-this\ # No comments here, please. > || do-that > > ... it might have been permissible but it ain't. I expect things like this really are no longer negotiable. There was a lengthy discussion about this a couple of years ago and is the reason that you can now make global aliases for syntactic tokens. ubuntu% alias -g '||'=';(( ! $? )) ||' ubuntu% false ubuntu% || echo no no ubuntu% alias -g '&&'=';(( ! $? )) &&' ubuntu% true ubuntu% && echo yes yes ubuntu% false ubuntu% && echo yes ubuntu% || echo no no ubuntu% true && echo yes yes ubuntu% || echo no ubuntu% false && echo yes || echo no no ubuntu% true || echo no && echo yes yes This only works because in shell language && and || have equal precedence, it would not work in a C-like language where && binds more tightly. Personally I have always thought that aliasing tokens is rather cringey, I would rather have done alias -g AND=';(( ! $? )) &&' alias -g OR=';(( ! $? )) ||' test-something AND do-this OR do-that Restricting ourselves instead to comment placement ... I'm not certain why you used "No comments here, please" as the text. Is that intended to convey some information to me as a reader of your question? Assuming not, a more reasonable approach would be to allow line continuation to appear AFTER a comment, e.g., [[ stuff ]] && do-this # Why did I do this? \ || do-that It's unlikely that any significant amount of existing code has comments ending with a backslash, but such a change would probably have to be controlled by an option nonetheless.