September 12, 2024Sep 12 (butlast '(1 2 3 4 5)) =>(1 2 3 4) (last '(1 2 3 4 5)) =>(5) (butlast '(1 2 3 4 5) 1) =>(1 2 3 4) (last '(1 2 3 4 5) 1) =>(5) (butlast '(1 2 3 4 5) 3) =>(1 2) (last '(1 2 3 4 5) 3) =>(3 4 5) or from the start (nthcdr 2 '(1 2 3 4 5)) =>(3 4 5) Jesper
September 13, 2024Sep 13 If the opposite of butlast is "butfirst" then in plain lisp is: (cdr '(1 2 3 4 5)) => (2 3 4 5) or (subseq '(1 2 3 4 5) 1) Achim
September 13, 2024Sep 13 or (rest '(1 2 3 4 5)) => (2 3 4 5) or (extended) (car (cdr (cadr (cddr (nthcdr .... CLHS: Accessor CAR, CDR, CAAR, CADR, CDAR... CLHS.LISP.SE nthcdr (Programming in Emacs Lisp) WWW.GNU.ORG nthcdr (Programming in Emacs Lisp)
Create an account or sign in to comment