core: last_pair: Move to core.
* src/lib.c (last_pair): New function. * module/mes/scm.mes (last-pair): Remove.
This commit is contained in:
parent
4fa6acc480
commit
18d143aa62
|
@ -157,11 +157,6 @@
|
|||
(if (= 0 n) x
|
||||
(list-tail (cdr x) (- n 1))))
|
||||
|
||||
(define (last-pair lst)
|
||||
(let loop ((lst lst))
|
||||
(if (or (null? lst) (null? (cdr lst))) lst
|
||||
(loop (cdr lst)))))
|
||||
|
||||
(define (iota n)
|
||||
(if (<= n 0) '()
|
||||
(append2 (iota (- n 1)) (list (- n 1)))))
|
||||
|
|
Loading…
Reference in a new issue