;#!/usr/bin/racket
;#lang scheme
(define (reverse-r sequence)
(foldr (lambda (x y) (append y (list x))) '() sequence))
(define (reverse-l sequence)
(foldl (lambda (x y) (append (list x) y)) '() sequence))
; Test
(define seq (list 1 2 3 4 5 6 7))
(display (reverse-r seq))
(newline)
(display (reverse-l seq))
(newline)
OyMhL3Vzci9iaW4vcmFja2V0CjsjbGFuZyBzY2hlbWUKCihkZWZpbmUgKHJldmVyc2UtciBzZXF1ZW5jZSkKICAgICAgICAoZm9sZHIgKGxhbWJkYSAoeCB5KSAoYXBwZW5kIHkgKGxpc3QgeCkpKSAnKCkgc2VxdWVuY2UpKQoKKGRlZmluZSAocmV2ZXJzZS1sIHNlcXVlbmNlKQogICAgICAgIChmb2xkbCAobGFtYmRhICh4IHkpIChhcHBlbmQgKGxpc3QgeCkgeSkpICcoKSBzZXF1ZW5jZSkpCgo7IFRlc3QKKGRlZmluZSBzZXEgKGxpc3QgMSAyIDMgNCA1IDYgNykpCgooZGlzcGxheSAocmV2ZXJzZS1yIHNlcSkpCihuZXdsaW5lKQoKKGRpc3BsYXkgKHJldmVyc2UtbCBzZXEpKQoobmV3bGluZSkK