문제

The definition is from src/code/array.lisp of sbcl. It looks like an infinite loop? I didn't find any clue to get it. Any hint? Thank you!

(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))       
도움이 되었습니까?

해결책

In src/compiler/array-tran.lisp you can also find this code:

(deftransform row-major-aref ((array index))
  `(hairy-data-vector-ref array
                          (%check-bound array (array-total-size array) index)))

I'm not an expert in SBCL internals, but I assume that row-major-aref is treated by the compiler as the "basic" operation that is not reduced to other Lisp function calls, but rather transformed to machine code.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top