zsh-workers
 help / Atom feed
From: Aryn Starr <whereislelouch@icloud.com>
To: Daniel Shahaf <d.s@daniel.shahaf.name>
Cc: zsh-workers@zsh.org
Subject: Re: [Feature Request] Adding option to support triple quotes
Date: Wed, 14 Aug 2019 01:10:37 +0430
Message-ID: <E757144A-6D24-4D61-B0CE-8EC67F12DAFE@icloud.com> (raw)
In-Reply-To: <f6985fa1-fdae-4b87-88ef-18e498ca01b8@www.fastmail.com>

The tripe single quotes can have single quotes in them, and the triple double quotes can have double quotes.
It’s useful for normal English interpolation:
“””I’m going to kill process “${some_process}.”
     Proceed? (Y/n)”””
It’s useful for regexes:
[[ “$sth” =~ ‘’’ “\w+”=‘?(\d+)’? ‘’’ ]]
It’s useful for putting code in strings, which is extremely useful for macros, code generators, evaling code of other languages (node -e, python -c, etc):
“”” $var_name=“\$$var_value”
“””

There are quite a few “...”’”’”...” and the like already in my code, and they are make the code unreadable and ugly. 

> On Aug 13, 2019, at 8:58 PM, Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> 
> Aryn Starr wrote on Tue, 13 Aug 2019 06:08 +00:00:
>> Adding an option to zsh to support triple quotes (TRIPLE_QUOTES) would 
>> make possible much more readable code.
>> We can have double triple quotes that support `$` interpolation, and 
>> triple single quotes that just take raw strings.
> 
> What would be the difference to ordinary «'…'» and «"…"» string
> literals?  They can already be multiline.


  reply index

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-13  6:06 Aryn Starr
2019-08-13  9:06 ` Mikael Magnusson
2019-08-13 20:52   ` Aryn Starr
2019-08-13 16:28 ` Daniel Shahaf
2019-08-13 20:40   ` Aryn Starr [this message]
2019-08-14  9:54 ` Stephane Chazelas
2019-08-15 14:28   ` Aryn Starr
2019-08-15 15:56     ` Daniel Shahaf
     [not found] <2c845fb0-d628-400f-a805-ad8356b6d87a@www.fastmail.com>
     [not found] ` <7EBD1ADA-7179-4EEF-97CA-DBE4371D80D6@icloud.com>
     [not found]   ` <876f807b-dfdd-4246-8cfe-7cf6f373ac88@www.fastmail.com>
     [not found]     ` <f053e72e-e22e-4729-a2de-eaa712119728@www.fastmail.com>
2019-08-15 16:23       ` Aryn Starr
2019-08-17  5:31         ` Bart Schaefer
2019-08-17  6:30           ` Stephane Chazelas
2019-08-17  8:19             ` Stephane Chazelas
2019-08-18  4:24             ` Mikael Magnusson

Reply instructions:

You may reply publically 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=E757144A-6D24-4D61-B0CE-8EC67F12DAFE@icloud.com \
    --to=whereislelouch@icloud.com \
    --cc=d.s@daniel.shahaf.name \
    --cc=zsh-workers@zsh.org \
    /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

zsh-workers

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-workers

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


AGPL code for this site: git clone https://public-inbox.org/ public-inbox