无法理解 sbcl 中“row-major-ref”的定义

use*_*284 3 sbcl common-lisp

定义来自sbcl的src/code/array.lisp。看起来像是无限循环?我没有找到任何线索来获取它。有什么提示吗?谢谢你!

(defun row-major-aref (array index)                                                  |
  #!+sb-doc                                                                          |
  "Return the element of array corressponding to the row-major index. This is        |
   SETF'able."                                                                       |
  (declare (optimize (safety 1)))                                                    |
  (row-major-aref array index))       
Run Code Online (Sandbox Code Playgroud)

Vse*_*kin 5

您还src/compiler/array-tran.lisp可以找到以下代码:

(deftransform row-major-aref ((array index))
  `(hairy-data-vector-ref array
                          (%check-bound array (array-total-size array) index)))
Run Code Online (Sandbox Code Playgroud)

我不是 SBCL 内部的专家,但我认为row-major-aref编译器将其视为“基本”操作,不会简化为其他 Lisp 函数调用,而是转换为机器代码。