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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28660 invoked from network); 12 Feb 2021 06:42:34 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 12 Feb 2021 06:42:34 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1613112154; b=GmE5BKJXmgOE16sKpj4+2ttYIw3gN2jZMK3P47bCVZdoIPKM4TZvObdirTl/roLfnP4lHkE7WZ ADIvVr2NEVsbDW6/0SX2T4LW0m3ZQ7MBhSTWgSwYBs1wt/Ys9PNSF9r1fx0F5cMb6hwghnlcH0 KZcUTUrJ0Xr2uIy0rEYcpd7DdJ4KcWLo/B05avYf26bghGLpxjTKsyvEcHPayjjZJsh3E1nu3b 8XjqyI4DgCullXgWOuTbNh23kF0aDbThdyEF69wkVHDlk8cdRVGQOJLIWlLrpsJR3RZW8sYf+2 fUTMkDzp8tZnoOdc9a6n0jnW2RIR/XgpDCeYHpBFFUhiXQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-io1-f54.google.com) smtp.remote-ip=209.85.166.54; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1613112154; bh=wrxp0fm5YbueXOvzIAv/Vy9dc/6pBzZQxgjesBJtJrY=; 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=EJGwXylOPQL+SSCVPVJB97NKGmZOzwEg0IFzGybtSep/3Derp2MqGpDBWMuOuddpuhcCCwDtKz nB+IXNuz/COiVfBj+Hvacns+r54JhS6VJmonIS7xHbM4nL08ueTTcFJ8i3ccCE3EDJeC+LGUpY 7PBPDEmCKNnsCkVVwUfJENQJLUfLSqkUqTHeLlTYx/8YfyIaS1ffZudErHT8HDD6quv0TfCPk7 zHZaHYeEAEiW3uRXeLjITDvLLhS88ieAy5DAKWsvhHuzdJVycXes5b8vaKLeE5ccLchEdgvhHK K9Buinln9MPIs5fCp3z2OzQbZt2Ab8ulGCs/hPlX30NALw==; 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=magaCybsRezImWyDv5hOa5mdR9elmK9qHpcfcewz48E=; b=m9RWFJhTCuPRhCjBMpUao11Lwh FIDdg5brMP0IOcpiBlcDd1T8Rc+mzKv8P1qo/j5zAzMNoDGOfi6NtKyQzmEiWNfgZGSf4gRXbSVTW 1xHN1KdfeIyXmq6H3Ye+H5nNr3kzLFYx10PNFWUYJ1EcZvJmpvTMVwbS6uuskg6owI9yNf55Ba+bn axpGOCHLocOsqL1G8Fd+Bxw2rbI7SfSC6MB7wxN/61nWQ0T0jJqG3RSjLnVBOAjjbUCq4fQizHPUP 9p/2oTd0kjpQziLderS+nDyLdTYeZ+/1YTRdvWSX0pbbhAymvO1MeOr+J5NQbvV/yzAoQbQji94WW /9exzFeQ==; Received: from authenticated user by zero.zsh.org with local id 1lAS9r-000IbC-DI; Fri, 12 Feb 2021 06:42:27 +0000 Authentication-Results: zsh.org; iprev=pass (mail-io1-f54.google.com) smtp.remote-ip=209.85.166.54; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-io1-f54.google.com ([209.85.166.54]:39204) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1lAS9T-000IM2-9c; Fri, 12 Feb 2021 06:42:06 +0000 Received: by mail-io1-f54.google.com with SMTP id s24so8278703iob.6 for ; Thu, 11 Feb 2021 22:42:03 -0800 (PST) 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=magaCybsRezImWyDv5hOa5mdR9elmK9qHpcfcewz48E=; b=d+1oKyX2SBwWix3ULxr6OC6yXtvqpaEeeyMacnoMl+N4x3h/VMfux6WDuRb2zxsM9T CPIanffThuL2BLy+8ftUL/T/JyGcOAIEZh95q7/yOTblywPa3XBMC+KHXi3eX8RRg8Et RMuEFmnmFyjhrwlYK21A+trOY6kX8oAX0kUmrPDJgW1ksmiXjc91ylH1yWluk4N8Spq3 +blEc4A9+qJ4abNfVsnRHfPB1vbDTa1u5bmXVDdWdb7Hklri+Xlv7Z6DQB1bI5uzfABt tHxfuU9OA6GJ+OzCVRYtpVUpPNbJxP0tb2x6pLmgENmy8irkdNrMexFs3c47fBWJk5/d hvbQ== 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=magaCybsRezImWyDv5hOa5mdR9elmK9qHpcfcewz48E=; b=P+k8Tqi9DJk7ar4UrVEyDy/dvkhgj11zV14B6AEmQF0rMknEfy60X5+T/VW25ACCuL 6DVMmUAbLB0nuIRzRqzADWw8Mq+h/S1jbC1CRC2j9MqbwMOW727WFUBtRJMZC16tokla 0Qq2VvkWM2wAeHn1Jk4D2uWv80qKjhgX80n9vIHyjxex98qBLArMSkCNnXNTN4JBROej /Sv+peRwYXv9W9riUwAkfC7fMWTTT6LmuofPVljo52Or2dCGfggCDi89apnvOo2dgcsR l0oryix8mpdmzY8kaSVmlSWHJcQQwFYF+Kzaq3HZZEYJrjC4LTS8/aLR2JopPdbgERhM EorA== X-Gm-Message-State: AOAM53012ogCVWrKJzcA9gm6DZ7ENanOcFf76jXn4r1B1/nM+wZg1BOu ZTKfpIFublsJr6k6OdOegOdgDmkjefYyFXneCIyfx4tu5Tk= X-Google-Smtp-Source: ABdhPJyHso7bGxSb3ZN/o6TASBi32gmN49nbE1ct4icyDV9vIvAIiZehcnaWhFd2TY6N6Mq3u5TN+wqPv8DnP1WHZv0= X-Received: by 2002:a6b:a0a:: with SMTP id z10mr1155596ioi.67.1613112122008; Thu, 11 Feb 2021 22:42:02 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Roman Perepelitsa Date: Fri, 12 Feb 2021 07:41:50 +0100 Message-ID: Subject: Re: Block comments ala Ray To: Bart Schaefer Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 48013 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: On Fri, Feb 12, 2021 at 7:17 AM Bart Schaefer wrote: > > On Tue, Feb 9, 2021 at 10:16 PM Roman Perepelitsa > wrote: > > > > On Wed, Feb 10, 2021 at 7:05 AM Bart Schaefer wrote: > > > > > > !# This begins a block comment. > > > This is merely rambling. > > > This #! is the last line of the block > > > > This can be very surprising because it's not how block comments work > > in other popular languages. > > I don't find that very compelling, because in shell the alternative is > to prefix every line with "#", which is exactly what Ray wants to > avoid. I understand that Ray wants this but I don't know why. What are the benefits of this: !# Lorem ipsum dolor sit amet #! over this: # Lorem ipsum # dolor sit amet ? Do these benefits justify adding new syntax that's unique to zsh? > Do you have inline comments in the shell now? No. I use zsh as my main shell and it doesn't support inline comments. > Do you only care about > inline comments that don't contain newlines? Yes. I should say that I don't care that much about inline comments. My point is that I would only ever use block comments as inline comments with no embedded newlines. > Do you disagree with me about how strangely this -- > > print this <# part is a comment > (lah-di-dah for perhaps hundreds of lines) > but this part #> is the rest of the command > > -- implicitly behaves if the embedded newlines can be inlined? If this were valid syntax, I would expect it to work like in C. In other words, I would expect there to be two commands: print this is the rest of the command > I think Ray at least disagrees with you, since he's willing to abuse > here-documents for the purpose, which also can't be inlined. Ray does many things that I wouldn't recommend ;-) > Do you not use block comments to delimit expository paragraphs? No. I mostly write C++ and I use single-line comments for everything except inline comments (those that don't span until the end of the line). This is standard practice at Google. I believe this is common in many other languages that have C-like comments (Java, C#, etc.). Whenever I worked on a code base that used block comments, they usually looked like this: /* * Lorem ipsum * dolor sit amet */ And almost never like this: /* Lorem ipsum dolor sit amet */ So block comments in my experience are most often used as if they were single-line comments. Roman.