zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Block comments ala Ray
Date: Thu, 11 Feb 2021 22:17:10 -0800	[thread overview]
Message-ID: <CAH+w=7Zd2gY-s5T1dDNEEujAh6197MzrUD-iZrVwZLzD=L7xVQ@mail.gmail.com> (raw)
In-Reply-To: <CAN=4vMonpZHPSarsC778_GMbD_h4ioTwT+bTFU=FZ7_zbXaMqQ@mail.gmail.com>

On Tue, Feb 9, 2021 at 10:16 PM Roman Perepelitsa
<roman.perepelitsa@gmail.com> wrote:
>
> On Wed, Feb 10, 2021 at 7:05 AM Bart Schaefer <schaefer@brasslantern.com> 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.

It might be possible to force it to look

!#
like this
#!

(that is, require newlines both before and after the delimiters), if
that seems more friendly, but then the question is what

!#
this
#! means

(did the block end, and if it did not then ...)?

> It also disallows inline comments --
> something I personally use in other languages.

Do you have inline comments in the shell now?  Do you only care about
inline comments that don't contain newlines?  As I mentioned, I
experimented with

print this <# is an inline #> comment

because "<#" in any existing script would be a syntax error; but as
soon as you allow newlines within the comment it becomes a verbose
form of backslash-newline continuation, which felt wrong.

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?

> I would go even further and say that the value provided by block
> comments resides almost exclusively in enabling inline comments.

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.

Do you not use block comments to delimit expository paragraphs?


  reply	other threads:[~2021-02-12  6:17 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-10  6:05 Bart Schaefer
2021-02-10  6:16 ` Roman Perepelitsa
2021-02-12  6:17   ` Bart Schaefer [this message]
2021-02-12  6:26     ` Bart Schaefer
2021-02-12  6:41     ` Roman Perepelitsa
2021-02-12  7:40       ` Stephane Chazelas
2021-02-12  7:46         ` Roman Perepelitsa
2021-02-12 15:30         ` Bart Schaefer
2021-02-12 15:45           ` Stephane Chazelas
2021-02-12 16:55             ` Bart Schaefer
2021-02-12 18:16               ` Lawrence Velázquez
2021-02-12 21:02                 ` Stephane Chazelas
2021-02-12 21:12                   ` Stephane Chazelas
2021-02-12 21:29                     ` Bart Schaefer
2021-02-13  7:37                       ` Stephane Chazelas
2021-02-15 22:28               ` Daniel Shahaf
2021-02-13  4:33       ` Bart Schaefer
2021-02-15  0:42       ` Greg Klanderman
2021-02-12 15:24     ` Matthew Martin
2021-02-12 16:18       ` Bart Schaefer
2021-02-15 21:30         ` Daniel Shahaf
2021-02-15 22:35           ` Bart Schaefer
2021-02-12 20:48 ` Bart Schaefer
2021-02-13  8:35 ` Stephane Chazelas
2021-02-13  8:53   ` Stephane Chazelas
2021-02-14 20:50     ` Bart Schaefer
2021-02-14 20:15   ` Bart Schaefer
2021-02-15  0:36     ` Vincent Lefevre
2021-02-15  1:07       ` Bart Schaefer
2021-02-15  1:38         ` Vincent Lefevre
2021-02-15 17:43     ` Stephane Chazelas
2021-02-15 22:06       ` Daniel Shahaf
2021-02-15 22:39         ` Bart Schaefer
2021-02-14 20:58   ` Bart Schaefer
2021-02-16 15:30 ` Juergen Christoffel
2021-02-16 17:21   ` Vincent Lefevre
2021-02-16 18:29     ` Bart Schaefer
2021-02-16 21:35     ` Juergen Christoffel
2021-02-16 18:21   ` pod documentation in zsh scripts (Was: Block comments ala Ray) Stephane Chazelas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7Zd2gY-s5T1dDNEEujAh6197MzrUD-iZrVwZLzD=L7xVQ@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).