zenspider
2021-1-20 01:44:07

Here’s my current version:

(defun nth* (n xs) "Select the Nth item from XS, zero based. Go backwards from the right if N is negative." (if (< n 0) (let* ((xs (vconcat xs))) (aref xs (+ (length xs) n))) (nth xs n))) tho… now that I’m thinking about it… maybe I should bench nth vs vconcat + aref for the general case too


zenspider
2021-1-20 01:45:29