mit Posted October 9, 2015 Share Posted October 9, 2015 Hello everyone Can you have the method to add a first of list to an end of list? Example : item '("a" "b" "c" "d") and add "a" to the end ===> item '("a" "b" "c" "d" "a") Please help me Quote Link to comment Share on other sites More sharing options...
BIGAL Posted October 9, 2015 Share Posted October 9, 2015 easy (setq lst (list "a" "b" "c" "d")) (setq lst (append lst (list (nth 0 lst)))) ; ("a" "b" "c" "d" "a") Quote Link to comment Share on other sites More sharing options...
mit Posted October 9, 2015 Author Share Posted October 9, 2015 Thank you so much BIGAL Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 9, 2015 Share Posted October 9, 2015 Others: (append lst (list (car lst))) (reverse (cons (car lst) (reverse lst))) Quote Link to comment Share on other sites More sharing options...
mit Posted October 9, 2015 Author Share Posted October 9, 2015 Thank you so much Lee Mac Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 9, 2015 Share Posted October 9, 2015 You're welcome mit. 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.