作者:ruanbaoshuijingkou | 来源:互联网 | 2022-10-17 12:59
我在Hyperspec或Common Lisp:The Language(第二版)中找不到此信息。与实现相关的常量,例如LAMBDA-PARAMETERS-LIMIT
和CALL-ARGUMENT-LIMIT
,但不是SYMBOL-NAME-LENGTH-LIMIT
或PRINTABLE-SYMBOL-NAME-MAX-LENGTH
。
名称最长的标准符号为UPDATE-INSTANCE-FOR-DIFFERENT-CLASS
和UPDATE-INSTANCE-FOR-REDEFINED-CLASS
,均为35个字符长,因此我想最多可以使用35个字符。我不希望再为符号命名更长的名称,但这可能有一天会很重要。
1> rsm..:
In Common Lisp the names of symbols are strings, strings are vectors (one-dimensional arrays) and thus the length of strings is limited by array-dimension-limit
.
According to CL HyperSpec http://www.lispworks.com/documentation/HyperSpec/Body/v_ar_dim.htm#array-dimension-limit array-dimension-limit
is:
A positive fixnum, the exact magnitude of which is implementation-dependent, but which is not less than 1024.
Practically, SBCL reports
* array-dimension-limit
4611686018427387901
so it's not really a limit.
旁注:CLtL2并不是真正的规格。在指定为ANSI Common Lisp之前,这是Common Lisp版本的语言描述。因此,实际的ANSI CL规格有所不同。HyperSpec的内容与HTML内容基本相同的HTML呈现为:http://www.lispworks.com/documentation/HyperSpec/Front/Contents.htm
@RainerJoswig哦,我不知道,谢谢!我将CLtL2部分更改为HyperSpec。