Re: Review Request 33558: Add C++11 lambdas to the C++ style guide.

2015-05-04 Thread Ben Mahler


> On April 28, 2015, 2:08 a.m., Ben Mahler wrote:
> > docs/mesos-c++-style-guide.md, lines 206-208
> > 
> >
> > What does it mean to pass a lambda to `socket.send`? Doesn't look like 
> > this is functionality provided on the existing socket we have, and I'm not 
> > sure what this would do.. provide a functor of the data?
> 
> Michael Park wrote:
> As this review is about style, I myself didn't dig into the validity of 
> this example all that much. But perhaps we should find a more realistic 
> example.
> 
> Benjamin Hindman wrote:
> I changed them all to 'instance.method'.

Thanks! Fixed one that was missed.


- Ben


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33558/#review81769
---


On April 28, 2015, 5:33 p.m., Benjamin Hindman wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33558/
> ---
> 
> (Updated April 28, 2015, 5:33 p.m.)
> 
> 
> Review request for mesos, Ben Mahler, Joris Van Remoortere, Michael Park, and 
> Vinod Kone.
> 
> 
> Bugs: MESOS-2669
> https://issues.apache.org/jira/browse/MESOS-2669
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary. Note that there will be a follow up review which enacts this 
> style in the code base.
> 
> 
> Diffs
> -
> 
>   docs/mesos-c++-style-guide.md fe98f90ad0b0f5dd38af97e85062e90cee8de99e 
> 
> Diff: https://reviews.apache.org/r/33558/diff/
> 
> 
> Testing
> ---
> 
> N/A
> 
> 
> Thanks,
> 
> Benjamin Hindman
> 
>



Re: Review Request 33558: Add C++11 lambdas to the C++ style guide.

2015-05-02 Thread Benjamin Hindman


> On April 26, 2015, 8:52 p.m., Michael Park wrote:
> > docs/mesos-c++-style-guide.md, lines 214-221
> > 
> >
> > Was this really intended to be marked `OK`? It doesn't look like a 
> > style we'll want to use to me.

Yes, I marked this as OK because of the version where 'socket.send(' is 
actually just a single function call like 'function(', I've updated the guide 
with this example and point to preferring the version that doesn't do it this 
way.


- Benjamin


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33558/#review81643
---


On April 28, 2015, 5:33 p.m., Benjamin Hindman wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33558/
> ---
> 
> (Updated April 28, 2015, 5:33 p.m.)
> 
> 
> Review request for mesos, Ben Mahler, Joris Van Remoortere, Michael Park, and 
> Vinod Kone.
> 
> 
> Bugs: MESOS-2669
> https://issues.apache.org/jira/browse/MESOS-2669
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary. Note that there will be a follow up review which enacts this 
> style in the code base.
> 
> 
> Diffs
> -
> 
>   docs/mesos-c++-style-guide.md fe98f90ad0b0f5dd38af97e85062e90cee8de99e 
> 
> Diff: https://reviews.apache.org/r/33558/diff/
> 
> 
> Testing
> ---
> 
> N/A
> 
> 
> Thanks,
> 
> Benjamin Hindman
> 
>



Re: Review Request 33558: Add C++11 lambdas to the C++ style guide.

2015-05-02 Thread Benjamin Hindman


> On April 28, 2015, 2:08 a.m., Ben Mahler wrote:
> > docs/mesos-c++-style-guide.md, line 211
> > 
> >
> > There is no "closing parenthesis" for a lambda..?

Fixed, thanks!


> On April 28, 2015, 2:08 a.m., Ben Mahler wrote:
> > docs/mesos-c++-style-guide.md, lines 206-208
> > 
> >
> > What does it mean to pass a lambda to `socket.send`? Doesn't look like 
> > this is functionality provided on the existing socket we have, and I'm not 
> > sure what this would do.. provide a functor of the data?
> 
> Michael Park wrote:
> As this review is about style, I myself didn't dig into the validity of 
> this example all that much. But perhaps we should find a more realistic 
> example.

I changed them all to 'instance.method'.


> On April 28, 2015, 2:08 a.m., Ben Mahler wrote:
> > docs/mesos-c++-style-guide.md, lines 237-294
> > 
> >
> > Hm.. this look a bit hard to read to me, you might think that the 
> > capture list is an argument as you scan case 1, for example, and it might 
> > be hard to distinguish the lambda from other arguments (consider if 
> > socket.send takes more arguments).
> > 
> > Would it be better to illustrate the wrapping via a variable?
> > 
> > ```
> > auto lambda = [&capture1, &capture2, &capture3]
> > (const T1& p1, const T2& p2, const T3& p3) {
> >   ...;
> > };
> > ```
> > 
> > One last note, it seeems nice in many cases to keep the opening 
> > parenthesis with the parameters rather than against the end of the capture 
> > list (e.g. as I did above). I realize that's not clean to do when you have 
> > to wrap the parameters as well though, so maybe not :)
> 
> Michael Park wrote:
> +1 to illustrating the examples via a variable.
> > One last note, it seeems nice in many cases to keep the opening 
> parenthesis with the parameters rather than against the end of the capture 
> list (e.g. as I did above). I realize that's not clean to do when you have to 
> wrap the parameters as well though, so maybe not :)
> 
> I don't like that it would deviate further from how we format parameters 
> of regular functions. In specific, we don't format functions like this:
> 
> ```cpp
> SomeLongReturnType SomeLongFunctionName
> (const T1& p1, const T2& p2, const T3& p3)
> {
>   ...
> }
> ```
> 
> we format it like this:
> 
> ```cpp
> SomeLongReturnType SomeLongFunctionName(
> const T1& p1, const T2& p2, const T3& p3)
> {
>   ...
> }
> ```
> 
> By "further" above I'm referring to the fact that we put a newline 
> between `) {` for regular functions whereas for lambdas we don't.

I've added examples for variables, thanks for the suggestions guys!


- Benjamin


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33558/#review81769
---


On April 28, 2015, 5:33 p.m., Benjamin Hindman wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33558/
> ---
> 
> (Updated April 28, 2015, 5:33 p.m.)
> 
> 
> Review request for mesos, Ben Mahler, Joris Van Remoortere, Michael Park, and 
> Vinod Kone.
> 
> 
> Bugs: MESOS-2669
> https://issues.apache.org/jira/browse/MESOS-2669
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary. Note that there will be a follow up review which enacts this 
> style in the code base.
> 
> 
> Diffs
> -
> 
>   docs/mesos-c++-style-guide.md fe98f90ad0b0f5dd38af97e85062e90cee8de99e 
> 
> Diff: https://reviews.apache.org/r/33558/diff/
> 
> 
> Testing
> ---
> 
> N/A
> 
> 
> Thanks,
> 
> Benjamin Hindman
> 
>



Re: Review Request 33558: Add C++11 lambdas to the C++ style guide.

2015-04-29 Thread Joris Van Remoortere

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33558/#review82027
---



docs/mesos-c++-style-guide.md


In some places you use `1: ...` and in others you use `1. ...`. Can we be 
consistent (also with the rest of the document)



docs/mesos-c++-style-guide.md


Did we want to indent these 4 more (i.e. 8 total) so that they don't align 
the same as the capture list?


- Joris Van Remoortere


On April 28, 2015, 5:33 p.m., Benjamin Hindman wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33558/
> ---
> 
> (Updated April 28, 2015, 5:33 p.m.)
> 
> 
> Review request for mesos, Ben Mahler, Joris Van Remoortere, Michael Park, and 
> Vinod Kone.
> 
> 
> Bugs: MESOS-2669
> https://issues.apache.org/jira/browse/MESOS-2669
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary. Note that there will be a follow up review which enacts this 
> style in the code base.
> 
> 
> Diffs
> -
> 
>   docs/mesos-c++-style-guide.md fe98f90ad0b0f5dd38af97e85062e90cee8de99e 
> 
> Diff: https://reviews.apache.org/r/33558/diff/
> 
> 
> Testing
> ---
> 
> N/A
> 
> 
> Thanks,
> 
> Benjamin Hindman
> 
>



Re: Review Request 33558: Add C++11 lambdas to the C++ style guide.

2015-04-28 Thread Benjamin Hindman

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33558/
---

(Updated April 28, 2015, 5:33 p.m.)


Review request for mesos, Ben Mahler, Joris Van Remoortere, Michael Park, and 
Vinod Kone.


Bugs: MESOS-2669
https://issues.apache.org/jira/browse/MESOS-2669


Repository: mesos


Description
---

See summary. Note that there will be a follow up review which enacts this style 
in the code base.


Diffs
-

  docs/mesos-c++-style-guide.md fe98f90ad0b0f5dd38af97e85062e90cee8de99e 

Diff: https://reviews.apache.org/r/33558/diff/


Testing
---

N/A


Thanks,

Benjamin Hindman



Re: Review Request 33558: Add C++11 lambdas to the C++ style guide.

2015-04-27 Thread Ben Mahler


> On April 28, 2015, 2:08 a.m., Ben Mahler wrote:
> > docs/mesos-c++-style-guide.md, line 162
> > 
> >
> > When would we use capture by reference? Seems prone to mistakes?
> 
> Michael Park wrote:
> > When would we use capture by reference?
> 
> We would use it when we know the lambda will be invoked within the scope. 
> For example, if we're calling an algorithm (e.g. `std::sort`) that takes a 
> lambda, we know that it'll be invoked within the scope.
> 
> > Seems prone to mistakes?
> 
> It is indeed prone to mistakes which is the motivation behind `*never* 
> use default capture by reference`.

Ah, right, synchronous code. :)


- Ben


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33558/#review81769
---


On April 26, 2015, 8:26 p.m., Benjamin Hindman wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33558/
> ---
> 
> (Updated April 26, 2015, 8:26 p.m.)
> 
> 
> Review request for mesos, Ben Mahler, Joris Van Remoortere, Michael Park, and 
> Vinod Kone.
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary. Note that there will be a follow up review which enacts this 
> style in the code base.
> 
> 
> Diffs
> -
> 
>   docs/mesos-c++-style-guide.md fe98f90ad0b0f5dd38af97e85062e90cee8de99e 
> 
> Diff: https://reviews.apache.org/r/33558/diff/
> 
> 
> Testing
> ---
> 
> N/A
> 
> 
> Thanks,
> 
> Benjamin Hindman
> 
>



Re: Review Request 33558: Add C++11 lambdas to the C++ style guide.

2015-04-27 Thread Michael Park


> On April 28, 2015, 2:08 a.m., Ben Mahler wrote:
> > docs/mesos-c++-style-guide.md, line 162
> > 
> >
> > When would we use capture by reference? Seems prone to mistakes?

> When would we use capture by reference?

We would use it when we know the lambda will be invoked within the scope. For 
example, if we're calling an algorithm (e.g. `std::sort`) that takes a lambda, 
we know that it'll be invoked within the scope.

> Seems prone to mistakes?

It is indeed prone to mistakes which is the motivation behind `*never* use 
default capture by reference`.


> On April 28, 2015, 2:08 a.m., Ben Mahler wrote:
> > docs/mesos-c++-style-guide.md, lines 206-208
> > 
> >
> > What does it mean to pass a lambda to `socket.send`? Doesn't look like 
> > this is functionality provided on the existing socket we have, and I'm not 
> > sure what this would do.. provide a functor of the data?

As this review is about style, I myself didn't dig into the validity of this 
example all that much. But perhaps we should find a more realistic example.


> On April 28, 2015, 2:08 a.m., Ben Mahler wrote:
> > docs/mesos-c++-style-guide.md, lines 237-294
> > 
> >
> > Hm.. this look a bit hard to read to me, you might think that the 
> > capture list is an argument as you scan case 1, for example, and it might 
> > be hard to distinguish the lambda from other arguments (consider if 
> > socket.send takes more arguments).
> > 
> > Would it be better to illustrate the wrapping via a variable?
> > 
> > ```
> > auto lambda = [&capture1, &capture2, &capture3]
> > (const T1& p1, const T2& p2, const T3& p3) {
> >   ...;
> > };
> > ```
> > 
> > One last note, it seeems nice in many cases to keep the opening 
> > parenthesis with the parameters rather than against the end of the capture 
> > list (e.g. as I did above). I realize that's not clean to do when you have 
> > to wrap the parameters as well though, so maybe not :)

+1 to illustrating the examples via a variable.
> One last note, it seeems nice in many cases to keep the opening parenthesis 
> with the parameters rather than against the end of the capture list (e.g. as 
> I did above). I realize that's not clean to do when you have to wrap the 
> parameters as well though, so maybe not :)

I don't like that it would deviate further from how we format parameters of 
regular functions. In specific, we don't format functions like this:

```cpp
SomeLongReturnType SomeLongFunctionName
(const T1& p1, const T2& p2, const T3& p3)
{
  ...
}
```

we format it like this:

```cpp
SomeLongReturnType SomeLongFunctionName(
const T1& p1, const T2& p2, const T3& p3)
{
  ...
}
```

By "further" above I'm referring to the fact that we put a newline between `) 
{` for regular functions whereas for lambdas we don't.


- Michael


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33558/#review81769
---


On April 26, 2015, 8:26 p.m., Benjamin Hindman wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33558/
> ---
> 
> (Updated April 26, 2015, 8:26 p.m.)
> 
> 
> Review request for mesos, Ben Mahler, Joris Van Remoortere, Michael Park, and 
> Vinod Kone.
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary. Note that there will be a follow up review which enacts this 
> style in the code base.
> 
> 
> Diffs
> -
> 
>   docs/mesos-c++-style-guide.md fe98f90ad0b0f5dd38af97e85062e90cee8de99e 
> 
> Diff: https://reviews.apache.org/r/33558/diff/
> 
> 
> Testing
> ---
> 
> N/A
> 
> 
> Thanks,
> 
> Benjamin Hindman
> 
>



Re: Review Request 33558: Add C++11 lambdas to the C++ style guide.

2015-04-27 Thread Ben Mahler

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33558/#review81769
---

Ship it!


Thanks! I'm curious, when we would ever use capture by reference? Seems prone 
to lifetime bugs.


docs/mesos-c++-style-guide.md


When would we use capture by reference? Seems prone to mistakes?



docs/mesos-c++-style-guide.md


Can you post the rendered markdown? Was this meant to be a bullet point? 
Does it render correctly?



docs/mesos-c++-style-guide.md


What does it mean to pass a lambda to `socket.send`? Doesn't look like this 
is functionality provided on the existing socket we have, and I'm not sure what 
this would do.. provide a functor of the data?



docs/mesos-c++-style-guide.md


There is no "closing parenthesis" for a lambda..?



docs/mesos-c++-style-guide.md


Hm.. this look a bit hard to read to me, you might think that the capture 
list is an argument as you scan case 1, for example, and it might be hard to 
distinguish the lambda from other arguments (consider if socket.send takes more 
arguments).

Would it be better to illustrate the wrapping via a variable?

```
auto lambda = [&capture1, &capture2, &capture3]
(const T1& p1, const T2& p2, const T3& p3) {
  ...;
};
```

One last note, it seeems nice in many cases to keep the opening parenthesis 
with the parameters rather than against the end of the capture list (e.g. as I 
did above). I realize that's not clean to do when you have to wrap the 
parameters as well though, so maybe not :)


- Ben Mahler


On April 26, 2015, 8:26 p.m., Benjamin Hindman wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33558/
> ---
> 
> (Updated April 26, 2015, 8:26 p.m.)
> 
> 
> Review request for mesos, Ben Mahler, Joris Van Remoortere, Michael Park, and 
> Vinod Kone.
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary. Note that there will be a follow up review which enacts this 
> style in the code base.
> 
> 
> Diffs
> -
> 
>   docs/mesos-c++-style-guide.md fe98f90ad0b0f5dd38af97e85062e90cee8de99e 
> 
> Diff: https://reviews.apache.org/r/33558/diff/
> 
> 
> Testing
> ---
> 
> N/A
> 
> 
> Thanks,
> 
> Benjamin Hindman
> 
>



Re: Review Request 33558: Add C++11 lambdas to the C++ style guide.

2015-04-26 Thread Mesos ReviewBot

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33558/#review81642
---


Patch looks great!

Reviews applied: [33558]

All tests passed.

- Mesos ReviewBot


On April 26, 2015, 8:26 p.m., Benjamin Hindman wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33558/
> ---
> 
> (Updated April 26, 2015, 8:26 p.m.)
> 
> 
> Review request for mesos, Ben Mahler, Joris Van Remoortere, Michael Park, and 
> Vinod Kone.
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary. Note that there will be a follow up review which enacts this 
> style in the code base.
> 
> 
> Diffs
> -
> 
>   docs/mesos-c++-style-guide.md fe98f90ad0b0f5dd38af97e85062e90cee8de99e 
> 
> Diff: https://reviews.apache.org/r/33558/diff/
> 
> 
> Testing
> ---
> 
> N/A
> 
> 
> Thanks,
> 
> Benjamin Hindman
> 
>



Re: Review Request 33558: Add C++11 lambdas to the C++ style guide.

2015-04-26 Thread Michael Park

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33558/#review81643
---



docs/mesos-c++-style-guide.md


Was this really intended to be marked `OK`? It doesn't look like a style 
we'll want to use to me.


- Michael Park


On April 26, 2015, 8:26 p.m., Benjamin Hindman wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33558/
> ---
> 
> (Updated April 26, 2015, 8:26 p.m.)
> 
> 
> Review request for mesos, Ben Mahler, Joris Van Remoortere, Michael Park, and 
> Vinod Kone.
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary. Note that there will be a follow up review which enacts this 
> style in the code base.
> 
> 
> Diffs
> -
> 
>   docs/mesos-c++-style-guide.md fe98f90ad0b0f5dd38af97e85062e90cee8de99e 
> 
> Diff: https://reviews.apache.org/r/33558/diff/
> 
> 
> Testing
> ---
> 
> N/A
> 
> 
> Thanks,
> 
> Benjamin Hindman
> 
>



Re: Review Request 33558: Add C++11 lambdas to the C++ style guide.

2015-04-26 Thread Benjamin Hindman


> On April 26, 2015, 3:51 a.m., Michael Park wrote:
> > docs/mesos-c++-style-guide.md, lines 195-201
> > 
> >
> > Alternative suggestion:
> > 
> > ```
> > socket
> >   .send([]() {
> > s1;
> > s2;
> >   })
> >   .then([]() {
> > s1;
> > s2;
> >   })
> >   .then([]() {
> > s1;
> > s2;
> >   });
> > ```
> > 
> > Compare with existing method chain formatting without lambdas:
> > 
> > ```
> > async(&state::recover, metaDir, flags.strict)
> >   .then(defer(self(), &Slave::recover, lambda::_1))
> >   .then(defer(self(), &Slave::_recover))
> >   .onAny(defer(self(), &Slave::__recover, lambda::_1));
> > ```
> > 
> > It would also stay consistent when non-lambdas (e.g. defer), 
> > single-line lambdas and multi-line lambdas are all used:
> > 
> > ```
> > socket
> >   .send([]() { s1; })
> >   .then(defer(self(), &Self::reuseable_callback, lambda::_1))
> >   .then([]() {
> > s1;
> > s2;
> >   });
> > ```
> > 
> > What do you think? I know we had already talked about this, but I 
> > realized this later.

Great! I've updated the review.


- Benjamin


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33558/#review81608
---


On April 26, 2015, 8:26 p.m., Benjamin Hindman wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33558/
> ---
> 
> (Updated April 26, 2015, 8:26 p.m.)
> 
> 
> Review request for mesos, Ben Mahler, Joris Van Remoortere, Michael Park, and 
> Vinod Kone.
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary. Note that there will be a follow up review which enacts this 
> style in the code base.
> 
> 
> Diffs
> -
> 
>   docs/mesos-c++-style-guide.md fe98f90ad0b0f5dd38af97e85062e90cee8de99e 
> 
> Diff: https://reviews.apache.org/r/33558/diff/
> 
> 
> Testing
> ---
> 
> N/A
> 
> 
> Thanks,
> 
> Benjamin Hindman
> 
>



Re: Review Request 33558: Add C++11 lambdas to the C++ style guide.

2015-04-26 Thread Benjamin Hindman

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33558/
---

(Updated April 26, 2015, 8:26 p.m.)


Review request for mesos, Ben Mahler, Joris Van Remoortere, Michael Park, and 
Vinod Kone.


Repository: mesos


Description
---

See summary. Note that there will be a follow up review which enacts this style 
in the code base.


Diffs (updated)
-

  docs/mesos-c++-style-guide.md fe98f90ad0b0f5dd38af97e85062e90cee8de99e 

Diff: https://reviews.apache.org/r/33558/diff/


Testing
---

N/A


Thanks,

Benjamin Hindman



Re: Review Request 33558: Add C++11 lambdas to the C++ style guide.

2015-04-26 Thread Benjamin Hindman

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33558/
---

(Updated April 26, 2015, 8:18 p.m.)


Review request for mesos, Ben Mahler, Joris Van Remoortere, Michael Park, and 
Vinod Kone.


Repository: mesos


Description
---

See summary. Note that there will be a follow up review which enacts this style 
in the code base.


Diffs (updated)
-

  docs/mesos-c++-style-guide.md fe98f90ad0b0f5dd38af97e85062e90cee8de99e 

Diff: https://reviews.apache.org/r/33558/diff/


Testing
---

N/A


Thanks,

Benjamin Hindman



Re: Review Request 33558: Add C++11 lambdas to the C++ style guide.

2015-04-25 Thread Michael Park

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33558/#review81608
---



docs/mesos-c++-style-guide.md


Alternative suggestion:

```
socket
  .send([]() {
s1;
s2;
  })
  .then([]() {
s1;
s2;
  })
  .then([]() {
s1;
s2;
  });
```

Compare with existing method chain formatting without lambdas:

```
async(&state::recover, metaDir, flags.strict)
  .then(defer(self(), &Slave::recover, lambda::_1))
  .then(defer(self(), &Slave::_recover))
  .onAny(defer(self(), &Slave::__recover, lambda::_1));
```

It would also stay consistent when non-lambdas (e.g. defer), single-line 
lambdas and multi-line lambdas are all used:

```
socket
  .send([]() { s1; })
  .then(defer(self(), &Self::reuseable_callback, lambda::_1))
  .then([]() {
s1;
s2;
  });
```

What do you think? I know we had already talked about this, but I realized 
this later.


- Michael Park


On April 26, 2015, 1:23 a.m., Benjamin Hindman wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33558/
> ---
> 
> (Updated April 26, 2015, 1:23 a.m.)
> 
> 
> Review request for mesos, Ben Mahler, Joris Van Remoortere, Michael Park, and 
> Vinod Kone.
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary. Note that there will be a follow up review which enacts this 
> style in the code base.
> 
> 
> Diffs
> -
> 
>   docs/mesos-c++-style-guide.md a9b56e3b5ef7e43af11903321d5c321c6203f79a 
> 
> Diff: https://reviews.apache.org/r/33558/diff/
> 
> 
> Testing
> ---
> 
> N/A
> 
> 
> Thanks,
> 
> Benjamin Hindman
> 
>



Re: Review Request 33558: Add C++11 lambdas to the C++ style guide.

2015-04-25 Thread Mesos ReviewBot

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33558/#review81605
---


Patch looks great!

Reviews applied: [33558]

All tests passed.

- Mesos ReviewBot


On April 26, 2015, 1:23 a.m., Benjamin Hindman wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33558/
> ---
> 
> (Updated April 26, 2015, 1:23 a.m.)
> 
> 
> Review request for mesos, Ben Mahler, Joris Van Remoortere, Michael Park, and 
> Vinod Kone.
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> See summary. Note that there will be a follow up review which enacts this 
> style in the code base.
> 
> 
> Diffs
> -
> 
>   docs/mesos-c++-style-guide.md a9b56e3b5ef7e43af11903321d5c321c6203f79a 
> 
> Diff: https://reviews.apache.org/r/33558/diff/
> 
> 
> Testing
> ---
> 
> N/A
> 
> 
> Thanks,
> 
> Benjamin Hindman
> 
>