| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Note: (setter car) == set-car!, and
(setter cdr) == set-cdr!.
caar == (car (car x)),
cadr == (car (cdr x)), and so on.
The corresponding setters are also defined.
(let ((x (list 1 2 3 4 5))) (set! (caddr x) -1) x) => (1 2 -1 4 5) |
If you want to handle circular lists as well,
See length+ in 10.2.4 List miscellaneous routines.
By default, list-ref signals an error if k is
negative, or greater than or equal to the length of list.
However, if an optional argument fallback is given,
it is returned for such case. This is an extension of Gauche.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |