[prev in list] [next in list] [prev in thread] [next in thread] 

List:       webkit-dev
Subject:    Re: [webkit-dev] [Styling] () for a lambda without arguments (Was Space between [] and () in C++ lam
From:       Ryosuke Niwa <rniwa () webkit ! org>
Date:       2019-11-03 3:27:06
Message-ID: CABNRm634_PdaEGM=aC5Rq+BxHz+=EfhEAJyH3MPe+wSKwFv4LA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Sat, Nov 2, 2019 at 8:25 PM Ryosuke Niwa <rniwa@webkit.org> wrote:

>
> On Sat, Nov 2, 2019 at 7:54 PM Chris Dumez <cdumez@apple.com> wrote:
>
>>
>>
>> On Nov 2, 2019, at 7:38 PM, Ryosuke Niwa <rniwa@webkit.org> wrote:
>>
>> 
>>
>> On Sat, Nov 2, 2019 at 1:23 AM Antti Koivisto <koivisto@iki.fi> wrote:
>>
>>>
>>> On Sat, Nov 2, 2019 at 1:38 AM Ryosuke Niwa <rniwa@webkit.org> wrote:
>>>
>>>> On Fri, Nov 1, 2019 at 11:53 AM Michael Catanzaro <mcatanzaro@gnome.org>
>>>> wrote:
>>>>
>>>>> On Fri, Nov 1, 2019 at 11:19 am, Ryosuke Niwa <rniwa@webkit.org>
>>>>> wrote:
>>>>> > Namely, some people write a lambda as:
>>>>> > auto x = [] () { }
>>>>> >
>>>>> > with a space between [] and () while others would write it as:
>>>>> >
>>>>> > auto x = []() { }
>>>>>
>>>>> 🔧: I omit the () when there are no parameters, as in these examples.
>>>>>
>>>>
>>>> I guess that's another thing we should decide. Should we, or should we
>>>> not have () when there are no arguments.
>>>>
>>>
>>> I think this is easily settled by voting via exiting practice. We have
>>> 1287 instances of [&] { and 107 instances of [&]() { and &] () { across the
>>> whole WebKit.
>>>
>>
>> That's good to know. Why don't we go with the status quo then.
>>
>> In this case, we do put a space between ] or ) and {, right?
>>
>>
>> How is this the conclusion from Antti's comment?
>>
>> Based on the discussion so far, it thought no space had a slight lead.
>>
>
> I think you're conflating this discussion with the other email thread
> about a space between [] and ().
>
> Here, I'm talking about placing a space after [] before { as in:
> [] { }
>
> As opposed to:
> []{ }
>
> We never use the latter style whether it's other control flow statements
> like if, while, or for, or for function definitions.
>
> - R. Niwa
>
> --
> - R. Niwa
>
-- 
- R. Niwa

[Attachment #5 (text/html)]

<div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On \
Sat, Nov 2, 2019 at 8:25 PM Ryosuke Niwa &lt;<a \
href="mailto:rniwa@webkit.org">rniwa@webkit.org</a>&gt; wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div><br></div><div><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">On Sat, Nov 2, 2019 at 7:54 PM Chris Dumez &lt;<a \
href="mailto:cdumez@apple.com" target="_blank">cdumez@apple.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><br><div \
dir="ltr"><br><blockquote type="cite">On Nov 2, 2019, at 7:38 PM, Ryosuke Niwa &lt;<a \
href="mailto:rniwa@webkit.org" target="_blank">rniwa@webkit.org</a>&gt; \
wrote:<br><br></blockquote></div><blockquote type="cite"><div \
dir="ltr"><div><br></div><div><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">On Sat, Nov 2, 2019 at 1:23 AM Antti Koivisto &lt;<a \
href="mailto:koivisto@iki.fi" target="_blank">koivisto@iki.fi</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div \
dir="ltr"><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On \
Sat, Nov 2, 2019 at 1:38 AM Ryosuke Niwa &lt;<a href="mailto:rniwa@webkit.org" \
target="_blank">rniwa@webkit.org</a>&gt; wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div \
dir="ltr"><div dir="ltr">On Fri, Nov 1, 2019 at 11:53 AM Michael Catanzaro &lt;<a \
href="mailto:mcatanzaro@gnome.org" target="_blank">mcatanzaro@gnome.org</a>&gt; \
wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" \
style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">On \
Fri, Nov 1, 2019 at 11:19 am, Ryosuke Niwa &lt;<a href="mailto:rniwa@webkit.org" \
target="_blank">rniwa@webkit.org</a>&gt; wrote:<br> &gt; Namely, some people write a \
lambda as:<br> &gt; auto x = [] () { }<br>
&gt; <br>
&gt; with a space between [] and () while others would write it as:<br>
&gt; <br>
&gt; auto x = []() { }<br>
<br>
🔧: I omit the () when there are no parameters, as in these \
examples.<br></blockquote><div><br></div><div>I guess that&#39;s another thing we \
should decide. Should we, or should we not have () when there are no \
arguments.</div></div></div></blockquote><div><br></div><div>I think this is easily \
settled by voting via exiting practice. We have 1287 instances of [&amp;] { and 107 \
instances  of [&amp;]() { and  &amp;] () { across the whole \
WebKit.</div></div></div></div></blockquote><div dir="auto"><br></div><div \
dir="auto">That's good to know. Why don't we go with the status quo then.</div><div \
dir="auto"><br></div><div dir="auto">In this case, we do put a space between ] or ) \
and {, right?</div></div></div></div></blockquote><div><br></div><div>How is this the \
conclusion from Antti's comment?</div><div><br></div><div>Based on the discussion so \
far, it thought no space had a slight lead.</div></div></blockquote><div \
dir="auto"><br></div><div dir="auto">I think you're conflating this discussion with \
the other email thread about a space between [] and ().</div><div \
dir="auto"><br></div><div dir="auto">Here, I'm talking about placing a space after [] \
before { as in:</div><div dir="auto">[] { }</div><div dir="auto"><br></div><div \
dir="auto">As opposed to:</div><div dir="auto">[]{ }</div><div \
dir="auto"><br></div><div dir="auto">We never use the latter style whether it's other \
control flow statements like if, while, or for, or for function \
definitions.</div><div dir="auto"><br></div><div dir="auto">- R. \
Niwa</div></div></div><div><div class="gmail_quote"><div \
dir="auto"><br></div></div></div>-- <br><div dir="ltr" \
data-smartmail="gmail_signature">- R. Niwa</div> </blockquote></div></div>-- <br><div \
dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">- R. Niwa</div>



_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic