lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


2018-01-07 16:24 GMT+02:00 Soni "They/Them" L. <fakedme@gmail.com>:
>
>
> On 2018-01-07 04:48 AM, Dirk Laurie wrote:
>>
>> 2018-01-07 5:01 GMT+02:00 Soni "They/Them" L. <fakedme@gmail.com>:
>>>
>>> With \z, multiline strings are nicer, as they can be indented:
>>>
>>> print("{\n\z
>>>      \x20   \"hello\": \"world\"\n\z
>>>      }")
>>>
>>> Sadly, as that example shows, I need to use an "\x20".
>>>
>>> It would be nice if "\ " (or, arguably, any other whitespace) was an
>>> explicit way to break a \z.
>>
>> Isn't that just a tortuous way of coding something that Lua
>> can do much more conveniently?
>>
>> print [[{
>>      "hello": "world"
>> }]]
>>
>
> Re-read the first line. For your convenience I'm pasting it here:
>
> "With \z, multiline strings are nicer, as they can be indented:"

Well, long strings (which were introduced in Lua 2.2) can be multiline
and can be indented. The "\z" escape sequence offers compatibilty
with Lua 2.1 but apart from that I can't see why one would use it
instead of a long string.