Maximum Method Name Length

前端 未结 9 1633
忘了有多久
忘了有多久 2020-11-30 05:19

Does anyone happen to know what the maximum length of a method name is in your programming language of choice? I was going to make this a C# specific question, but I think i

相关标签:
9条回答
  • 2020-11-30 06:06

    Common Lisp symbols's names are strings; strings have a length limit of array-dimension-limit

    The value of array-dimension-limit is a positive integer that is the upper exclusive bound on each individual dimension of an array. This bound depends on the implementation but will not be smaller than 1024. (Implementors are encouraged to make this limit as large as practicable without sacrificing performance.)

    In practice this can be quite large

    Welcome to Clozure Common Lisp Version 1.3-dev-r11583M-trunk  (DarwinX8664)!
    ? array-dimension-limit
    72057594037927936
    ? 
    
    Welcome to Clozure Common Lisp Version 1.3-dev-r11583M-trunk  (DarwinX8632)!
    ? array-dimension-limit
    16777216
    ? 
    

    This answer ignores the method name's package name; this could double the lengh.

    0 讨论(0)
  • 2020-11-30 06:12

    For C# I don't believe there's a specified hard limit. (Section 2.4.2 of the C# 5 spec doesn't give a limit, for example.) Roslyn v2.2.0.61624 seems to have a limit of 1024 characters; this is way beyond the bounds of readability and even a sensible machine-generated name.

    For Java, section 3.8 of the spec states:

    An identifier is an unlimited-length sequence of Java letters and Java digits, the first of which must be a Java letter.

    0 讨论(0)
  • 2020-11-30 06:15

    in C# is 511 characters length.

    0 讨论(0)
提交回复
热议问题