Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Block comments ala Ray



On Tue, Feb 09, 2021 at 10:05:13PM -0800, Bart Schaefer wrote:

Any other thoughts about this?  Too horrible to consider?  It needs
turning off in emulation modes and I haven't gotten to that yet.

While I love to use zsh for various scripts, I switch to e.g. perl for more
complicated / larger scripts (because doing everything in a shell looks
like using the mythical hammer which regards everything as a nail ;-)

That said, wouldn't it be possible to augment the comment parsing to use
something like perl's "plain old documentation" (pod) meachnism, e.g.

#=pod
This is a block comment
and $foo would not have a special meaning inside it
really
#=cut

This "#=" would allow to introduce more control statements inside the block
comment later on, just like perl's pod, which uses it's own little markup
language inside those blocks to mark up text

Cheers, JC

P.S. Even the use of the here document for block comments look less
horrible to me, because it's easily recognized when looking at a script.

--
 It is easier to port a shell than a shell script.
	-- Larry Wall




Messages sorted by: Reverse Date, Date, Thread, Author