リストの最後の要素を取り出す方法は3つある。
lengthを使う方法。
reverseを使う方法。
そしてlastを使う方法。
[8]> (setf x `(a b c d)) (A B C D) [9]> (elt x (- (length x) 1)) D [10]> (first (reverse x)) D [11]> (last x) (D)
リストの最後の要素を取り出す方法は3つある。
lengthを使う方法。
reverseを使う方法。
そしてlastを使う方法。
[8]> (setf x `(a b c d)) (A B C D) [9]> (elt x (- (length x) 1)) D [10]> (first (reverse x)) D [11]> (last x) (D)