Or am I doing something wrong, or it does not work)
(define ln (lambda (list) (cond ((eq? list () 0) (#t (+ (ln (cdr list)) 1)) )))) Or am I doing something wrong, or it does not work)
(define ln (lambda (list) (cond ((eq? list () 0) (#t (+ (ln (cdr list)) 1)) )))) In general, there is a function last , but like this:
(define (last-el l) (cond ((null? (cdr l)) (car l)) (else (last-el (cdr l))))) Source: https://ru.stackoverflow.com/questions/582915/
All Articles