libera/#lisp - IRC Chatlog
Search
9:56:26
JohnMS_WORK
I get that if I do (format t "~a ~a" (car list) (cdr list)) I will get the first and the rest of the list. What I can't figure out is how to get the rest of a list when I use (caddr list)?
10:00:43
moon-child
(caddr x) is the same as (car (cdr (cdr x))). If (cdr (cdr x)) is a list which you are interested in, then you can get the rest of it using (cdr (cdr (cdr x))), as with any othe rlist
10:00:57
JohnMS_WORK
I'm grabbing the first three elements off a list. Now I want to pass the rest of the list without the three I picked off.
10:04:13
jackdaniel
some people would say that destructuring-bind is noisily lengthy, they'd be right
10:04:28
moon-child
if l is a lexical variable denoting a list, then (pop l) will change the variable, but it will not change the list
10:11:17
jackdaniel
nthcdr is the name of the function; if you need to separate words then you use a kebab-case
16:46:02
White_Flame
he's no longer here, but (destructuring-bind (a b c &rest rest) data ...) would also seem pretty idiomatic