zsh-users
 help / color / mirror / code / Atom feed
* comment block curiosity
@ 2021-01-03 17:09 Ray Andrews
  2021-01-03 17:26 ` Bart Schaefer
  0 siblings, 1 reply; 11+ messages in thread
From: Ray Andrews @ 2021-01-03 17:09 UTC (permalink / raw)
  To: Zsh Users

Emboldened by Bart's showing how fundamental syntax might be aliased, 
and knowing how dangerous that might be, yet I thought I'd play with 
that.  I've always thought we should have block comments and of course 
you can fake it very well with:

    : <<COMMENTBLOCK

    foo
    bar
    baz

    COMMENTBLOCK

... But I thought I'd try to alias that because I keep forgetting the " 
: << " syntax.  So:

    alias startcomment=': <<COMMENTBLOCK'
    alias endcomment='COMMENTBLOCK'

    echo about to start a comment:

    startcomment        # This actually works believe it or not.

    foo
    bar
    baz

    endcomment         # This is ignored, it doesn't work but no error
    either.
    COMMENTBLOCK       # This ends the comment.

    echo back to working code.


You'd think that "endcomment' would be the alias more likely to work but 
it it doesn't.  Why?  Can it be fixed?




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-01-04 19:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-03 17:09 comment block curiosity Ray Andrews
2021-01-03 17:26 ` Bart Schaefer
2021-01-03 17:36   ` Ray Andrews
2021-01-03 17:43     ` Bart Schaefer
2021-01-03 18:30       ` Ray Andrews
2021-01-03 18:50         ` Bart Schaefer
2021-01-03 21:17           ` Ray Andrews
2021-01-03 21:31           ` Ray Andrews
2021-01-04  6:10             ` Daniel Shahaf
2021-01-04 17:09               ` Ray Andrews
2021-01-04 19:28                 ` Bart Schaefer

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).