Duncan P. N. Exon Smith via llvm-dev
2018-Jul-05 19:57 UTC
[llvm-dev] RFC: should we spell lambdas like functions?
I argue we should spell C++ lambdas (and other function-like variables) like functions, not like variables. - Use verbs, not nouns. - Use lowerCamelCase. Here's a patch that implements the change to the coding standards: https://reviews.llvm.org/D48991 <https://reviews.llvm.org/D48991> Thoughts? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180705/e4df70b8/attachment.html>
Rui Ueyama via llvm-dev
2018-Jul-05 20:09 UTC
[llvm-dev] RFC: should we spell lambdas like functions?
On Thu, Jul 5, 2018 at 12:57 PM Duncan P. N. Exon Smith < dexonsmith at apple.com> wrote:> I argue we should spell C++ lambdas (and other function-like variables) > like functions, not like variables. > > - Use verbs, not nouns. >I think I agree with this.> - Use lowerCamelCase. >In lld we use UpperCamelCase, as they are technically not function names but variable names. Using lowerCamelCase for function pointers feels really weird to me, as they are really variables than functions to me.>-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180705/6fa1ed47/attachment.html>
Adrian Prantl via llvm-dev
2018-Jul-06 00:30 UTC
[llvm-dev] RFC: should we spell lambdas like functions?
> On Jul 5, 2018, at 1:09 PM, Rui Ueyama via llvm-dev <llvm-dev at lists.llvm.org> wrote: > >> On Thu, Jul 5, 2018 at 12:57 PM Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote: >> I argue we should spell C++ lambdas (and other function-like variables) like functions, not like variables. >> >> - Use verbs, not nouns. > > I think I agree with this. > >> - Use lowerCamelCase. > > In lld we use UpperCamelCase, as they are technically not function names but variable names. Using lowerCamelCase for function pointers feels really weird to me, as they are really variables than functions to me.I also agree that this is weird either way because they are variables when declared and passed around and functions when invoked. A potential solution would be to adopt the style that large parts of the Clang frontend (informally) uses, and spell variables as lowerCamelCase, too. -- adrian
Chris Lattner via llvm-dev
2018-Jul-07 15:15 UTC
[llvm-dev] RFC: should we spell lambdas like functions?
> On Jul 5, 2018, at 12:57 PM, Duncan P. N. Exon Smith via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > I argue we should spell C++ lambdas (and other function-like variables) like functions, not like variables. > > - Use verbs, not nouns. > - Use lowerCamelCase. > > Here's a patch that implements the change to the coding standards: > https://reviews.llvm.org/D48991 <https://reviews.llvm.org/D48991>Makes sense to me, I think that all callable values could be named in the same approach, including function references and std::functions? Function pointers are not callable (you need to dereference them) so it is arguable that they should be capitalized. It would be nice to include some rationale of why you’re picking one thing or another in coding standard paragraph. -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180707/82a34f6d/attachment.html>
Chris Lattner via llvm-dev
2018-Jul-07 15:16 UTC
[llvm-dev] RFC: should we spell lambdas like functions?
> On Jul 7, 2018, at 8:15 AM, Chris Lattner <clattner at nondot.org> wrote: > > > >> On Jul 5, 2018, at 12:57 PM, Duncan P. N. Exon Smith via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote: >> >> I argue we should spell C++ lambdas (and other function-like variables) like functions, not like variables. >> >> - Use verbs, not nouns. >> - Use lowerCamelCase. >> >> Here's a patch that implements the change to the coding standards: >> https://reviews.llvm.org/D48991 <https://reviews.llvm.org/D48991> > Makes sense to me, I think that all callable values could be named in the same approach, including function references and std::functions? Function pointers are not callable (you need to dereference them) so it is arguable that they should be capitalized. It would be nice to include some rationale of why you’re picking one thing or another in coding standard paragraph.Err, yeah, of course function pointers are callable. I meant to say C++ member pointers :) -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180707/02d7b180/attachment.html>
Chandler Carruth via llvm-dev
2018-Jul-11 10:38 UTC
[llvm-dev] RFC: should we spell lambdas like functions?
On Thu, Jul 5, 2018 at 12:57 PM Duncan P. N. Exon Smith via llvm-dev < llvm-dev at lists.llvm.org> wrote:> I argue we should spell C++ lambdas (and other function-like variables) > like functions, not like variables. > > - Use verbs, not nouns. >Totally agree.> - Use lowerCamelCase. >Really disagree. I don't like having two different case conventions for variables. They're all variables, and I think they should be named using the same convention.> > Here's a patch that implements the change to the coding standards: > https://reviews.llvm.org/D48991 > > Thoughts? > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180711/7a5d5a25/attachment.html>
Krzysztof Parzyszek via llvm-dev
2018-Jul-11 13:20 UTC
[llvm-dev] RFC: should we spell lambdas like functions?
On 7/11/2018 5:38 AM, Chandler Carruth via llvm-dev wrote:> > I don't like having two different case conventions for variables. > They're all variables, and I think they should be named using the same > convention.Really agree. What about situations where a function is a parameter: template <typename Func> void fred(int Arg, Func Do) {...} If we use lowercase names for the function parameters it is going to look awful. -Krzysztof -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Lang Hames via llvm-dev
2018-Jul-14 03:08 UTC
[llvm-dev] RFC: should we spell lambdas like functions?
> > - Use lowerCamelCase. > >FWIW I would prefer to name them like variables too. Since being callable is their raison d'etre I'm unlikely to forget to use them that way. On the other hand, naming them like variables is a subtle but helpful reminder that they can be assigned to, moved from, may be default constructed (and so in a not-callable state), etc. Cheers, Lang. On Wed, Jul 11, 2018 at 3:39 AM Chandler Carruth via llvm-dev < llvm-dev at lists.llvm.org> wrote:> On Thu, Jul 5, 2018 at 12:57 PM Duncan P. N. Exon Smith via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> I argue we should spell C++ lambdas (and other function-like variables) >> like functions, not like variables. >> >> - Use verbs, not nouns. >> > > Totally agree. > > >> - Use lowerCamelCase. >> > > Really disagree. > > I don't like having two different case conventions for variables. They're > all variables, and I think they should be named using the same convention. > > >> >> Here's a patch that implements the change to the coding standards: >> https://reviews.llvm.org/D48991 >> >> Thoughts? >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180713/27a39ca9/attachment.html>
Seemingly Similar Threads
- RFC: should we spell lambdas like functions?
- RFC: should we spell lambdas like functions?
- [LLVMdev] local lambdas: request for coding standard clarification/judgement call
- RFC: changing variable naming rules in LLVM codebase
- changing variable naming rules in LLVM codebase