[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [Proposal] Can we have "\ ", for use with "\z"?
- From: "Soni \"They/Them\" L." <fakedme@...>
- Date: Mon, 22 Feb 2021 09:56:08 -0300
On 2021-02-22 6:39 a.m., Egor Skriptunoff wrote:
On Mon, Feb 22, 2021 at 6:00 AM Soni "They/Them" L. wrote:
local foo = "USAGE\n\z
Why do you want to put such unpleasant-looking thing in your code?
Lua offers much nicer variant:
local foo = [=[
If you want to indent it:
local foo = ([=[
:gsub("%f[^\n%z][ \t]*\\", "")
Please note that the text is more easily readable because you don't
see all that \n\z-garbage.
IMO, "\z" is a good option for long strings of data (kilobytes of
But for human-readable text the preferred option is long brackets.
"\z" allows one to use other escapes, you aren't required to put
newlines on every line, etc. there are lots of benefits to it.