Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Block comments ala Ray
- X-seq: zsh-workers 48036
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Block comments ala Ray
- Date: Fri, 12 Feb 2021 20:33:51 -0800
- Archived-at: <https://zsh.org/workers/48036>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-02/CAH%2Bw%3D7bJ7DOyViCo6LAAd-od0UjUn%2BKRkis7rnACgS%2BUo%3DTQkw%40mail.gmail.com>
- In-reply-to: <CAN=4vMoYj3WbBk3BL98buiYcf7rkLtw=b9v_f0p1C4zqYRB7xg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7YZREq7FbJCCoWoJ-vQ7+P5Z=_mKB-aStoMiBRupqD_wA@mail.gmail.com> <CAN=4vMonpZHPSarsC778_GMbD_h4ioTwT+bTFU=FZ7_zbXaMqQ@mail.gmail.com> <CAH+w=7Zd2gY-s5T1dDNEEujAh6197MzrUD-iZrVwZLzD=L7xVQ@mail.gmail.com> <CAN=4vMoYj3WbBk3BL98buiYcf7rkLtw=b9v_f0p1C4zqYRB7xg@mail.gmail.com>
On Thu, Feb 11, 2021 at 10:42 PM Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
>
> Do these benefits justify adding new syntax that's unique to zsh?
It's not as though zsh doesn't have lots of other unique syntax.
> On Fri, Feb 12, 2021 at 7:17 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> >
> > 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
It turns out not to be very difficult to make !# ... #! (or <# ... #>)
work that way, but ... that's not really how it works in C. You
wouldn't expect
int /* watch me explain
why this next variable
is not a float */ thing;
to behave like "int; thing;". My original point is that the shell
doesn't have the syntactic clues to tell you that "print this" (in the
example) is not already a complete command, the way you can tell in C
by the missing semicolon that something must eventually be coming
after "int".
Messages sorted by:
Reverse Date,
Date,
Thread,
Author