fork download
  1. (define (reverse xs)
  2. (if (null? xs)
  3. '()
  4. (append (reverse (cdr xs)) (list (car xs)))))
  5.  
  6. (define x (list 1 2 3))
  7.  
  8. (display (reverse x))
  9. (newline)
  10.  
  11. (display (append (list (caddr x)) (append (list (cadr x)) (append (list (car x)) '()))))
  12. (newline)
  13.  
  14. (display (append (list (caddr x)) (append (list (cadr x)) (list (car x)))))
  15. (newline)
Success #stdin #stdout 0.01s 8672KB
stdin
Standard input is empty
stdout
(3 2 1)
(3 2 1)
(3 2 1)