zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@sunsite.dk
Subject: Re: Multiline Anonymous Literal Strings
Date: Thu, 28 Sep 2006 21:52:46 -0700	[thread overview]
Message-ID: <060928215246.ZM4576@torch.brasslantern.com> (raw)
In-Reply-To: <20060928175133.GA26895@cetus5.cs.utk.edu>

On Sep 28,  1:51pm, Chris Johnson wrote:
}
} Anyone know of a way to compose a long literal string without doing
} something like this?

The following requires "setopt multios" (which is the default, but a
few people turn it off):

alias mycommand=${(j: :)"${(f)$(<<<'print this is one string'
# This is a comment, but you cannot use unbalanced quotes in it
<<<'this is a more "     " spacey "     " string'
<<<'this is a third string')}"}

I believe it to be a parsing bug that the comment is not treated as
a comment until the command substution is executed, rather than when
it is "compiled", but it's the closest approximation to what you want
that you're going to find.

} In C, contiguous quoted strings are implicitly joined at a compile time

You darned young whippersnappers and your fancy-ANSI programming!  In
my day you ate your backslashes with your K&R, and liked them.
 
} In Perl and other languages, concatenation operators like ., &, and +
} are available.

And your point is?

The syntax of the shell language (which is only implemented by zsh, not
defined by it) precludes the use of infix operators.


  parent reply	other threads:[~2006-09-29  4:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-28 17:51 Chris Johnson
2006-09-28 17:57 ` Michael Hernandez
2006-09-28 18:27   ` Chris Johnson
2006-09-28 18:26 ` Frank Terbeck
2006-09-29  4:52 ` Bart Schaefer [this message]
2006-10-02 12:42   ` Chris Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=060928215246.ZM4576@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).