C++ Logo

std-discussion

Advanced search

Re: Optional Semicolons

From: Lénárd Szolnoki <cpp_at_[hidden]>
Date: Thu, 28 Apr 2022 19:33:23 +0100
I don't see how your rules prevent that. Both `a = b;` and `+ c;` are valid statements.

On 28 April 2022 19:26:40 BST, William Linkmeyer <wlink10_at_[hidden]> wrote:
>That code would be entirely unaffected.
>
>WL
>
>> On Apr 28, 2022, at 2:23 PM, Lénárd Szolnoki via Std-Discussion <std-discussion_at_[hidden]> wrote:
>>
>> Hi,
>>
>> I would like to add that this is an existing line break style. Some people like it, because the operator is visually close to both of the operands, and it's at a consistent place. clang-format also has an option for this (although somewhat broken).
>>
>> It's especially nice that it can be easily parsed that the statement continues on the next line, because of the missing semicolon.
>>
>> Cheers,
>> Lénárd
>>
>>
>>
>>> On 28 April 2022 18:20:53 BST, Christof Meerwald via Std-Discussion <std-discussion_at_[hidden]> wrote:
>>>> On Thu, Apr 28, 2022 at 01:11:36PM -0400, William Linkmeyer via Std-Discussion wrote:
>>>> I’ve been considering writing a paper which allows the programmer to elide semicolons when the statement is otherwise followed by any number of whitespace and a newline.
>>>
>>> so something like
>>>
>>> a = b
>>> + c;
>>>
>>> now changes meaning?
>>>
>>>
>>> Christof
>>>
>>> --
>>>
>>> https://cmeerw.org sip:cmeerw at cmeerw.org
>>> mailto:cmeerw at cmeerw.org xmpp:cmeerw at cmeerw.org
>> --
>> Std-Discussion mailing list
>> Std-Discussion_at_[hidden]
>> https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion

Received on 2022-04-28 18:33:25