Scoutr4 Posted July 30, 2023 Share Posted July 30, 2023 (edited) i want to edit the list like this : Example : List ; ( 1 2 3 4 5 6 7 8 9) how do i make the new list? New List ; ((1 2 3) (4 5 6) (7 8 9)) Edited July 30, 2023 by Scoutr4 Quote Link to comment Share on other sites More sharing options...
Tsuky Posted July 30, 2023 Share Posted July 30, 2023 Possible way (defun l-to-3 (lst / ) (if lst (cons (list (car lst) (cadr lst) (caddr lst) ) (l-to-3 (cdddr lst)) ) ) ) (mapcar '(lambda (x) (vl-remove nil x)) (l-to-3 (list 1 2 3 4 5 6 7 8 9 10))) 1 Quote Link to comment Share on other sites More sharing options...
Scoutr4 Posted July 30, 2023 Author Share Posted July 30, 2023 Thank you so much @Tsuky Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 30, 2023 Share Posted July 30, 2023 There is a lot of list manipulation examples in the Challenges section of the swamp similar to what you were looking for worth having a look. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.