Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Block comments ala Ray
- X-seq: zsh-workers 48061
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Block comments ala Ray
- Date: Mon, 15 Feb 2021 22:28:30 +0000
- Archived-at: <https://zsh.org/workers/48061>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-02/20210215222830.GD4949%40tarpaulin.shahaf.local2>
- In-reply-to: <CAH+w=7bLXK_rZPsx33BTyKb5Q43uPc3W4Ayf0A8Gfkik0W9r9A@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> <20210212074031.7746vg37xykniem5@chazelas.org> <CAH+w=7ZT3vgGVd_NAndnDt2zbLwGV3Pwu=7+utEuwvSkKd4jOA@mail.gmail.com> <20210212154547.iy35rp4ijaef22ld@chazelas.org> <CAH+w=7bLXK_rZPsx33BTyKb5Q43uPc3W4Ayf0A8Gfkik0W9r9A@mail.gmail.com>
Bart Schaefer wrote on Fri, Feb 12, 2021 at 08:55:04 -0800:
> On Fri, Feb 12, 2021 at 7:45 AM Stephane Chazelas <stephane@xxxxxxxxxxxx> wrote:
> >
> > 2021-02-12 07:30:23 -0800, Bart Schaefer:
> > > On Thu, Feb 11, 2021 at 11:40 PM Stephane Chazelas
> > > <stephane@xxxxxxxxxxxx> wrote:
> > > >
> > > > :||:<<'# some comment'
> > >
> > > That's exactly what the zsh-users discussion has been telling Ray he
> > > should not do, because at some point it's not going to work the way he
> > > expects.
> > [...]
> >
> > How so?
>
> What was said on zsh-users (not by me):
>
> "Here-documents are not comments, despite your best efforts to abuse
> them for that role."
>
> "The construct you use has side-effects you've overlooked, which mean
> your fashion of comments will backfire in a way that you don't see yet."
For context, that's me from users/26342. The original paragraph also spells
out that the "side-effects" in question are that lastval will be reset.
> (Paraphrased) There are places where you might want comments but that
> command syntax is not allowed, for example in the midst of "for ...
> do".
>
> > How would it be different from your !# .. #! ?
>
> For one thing, the content of a here-document is "compiled" into the
> wordcode of the script or function, even if the command referencing
> that here-document is never going to execute. True comments are
> discarded during lexing.
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author