fork(2) download
  1. (define (max a b) (cond ((> a b) a b)))
  2. (define (one-elem-list l) (and (list? l) (and (not (null? l)) (null? (cdr l)))))
  3.  
  4. (define (f l)
  5. (define (go a b l)
  6. (cond ((null? l) (max a b)
  7. (one-elem-list (car l)) (go a (+ 1 b) (cdr l))
  8. (go (max a b) 0 (cdr l)))))
  9. (go 0 0 l))
  10.  
  11. (display (f '(1 1 1)))
  12. (display (f '(1 (1) (1) 1 (1) ((1 1 1)) (1) (1) (1 1) (1) (1) 1 (1))))
Success #stdin #stdout 0s 8672KB
stdin
Standard input is empty
stdout
#<unspecified>#<unspecified>