[llvm-dev] RFC: should we spell lambdas like functions?

Adrian Prantl via llvm-dev llvm-dev at lists.llvm.org
Thu Jul 5 17:30:57 PDT 2018



> 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



More information about the llvm-dev mailing list