fork download
  1. (define (enumerate-interval low high)
  2. (if (> low high)
  3. '()
  4. (cons low (enumerate-interval (+ low 1) high))))
  5.  
  6. (define (enumerate-tree tree)
  7. (cond ((null? tree) '())
  8. ((not (pair? tree)) (list tree))
  9. (else (append (enumerate-tree (car tree))
  10. (enumerate-tree (cdr tree)))))
  11.  
  12.  
  13. (display (enumerate-tree (list 1 (list 2 (list 3 4) 5)))))
  14. (newline)
  15. (enumerate-tree (list 1 (list 2 (list 3 4) 5)))
  16.  
Runtime error #stdin #stdout 0.12s 9376KB
stdin
Standard input is empty
stdout
Standard output is empty