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

Re: lexing



Ray Andrews wrote on Sun, Nov 29, 2015 at 18:10:30 -0800:
> On 11/29/2015 10:07 AM, Bart Schaefer wrote:
> >The form you're using (#something), is only not-a-comment in pattern
> >or filename-generation context, so $(# this IS a comment).
> 
> When will I run out of things that astonish me about zsh syntax?
> What sort of need would there be to put a comment inside " $(#...) "
> ?  So that's a comment but " (#b) " is not a comment ... sometimes,
> but don't bet on it.

For the same reason as always — to document things for the next reader:

    echo $( # Use a subshell because foo chokes if isatty(1)
            foo
          )

I don't think Bart mentioned the subshell syntax:

    ( # this is a comment
      echo 42 )



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