Created
June 5, 2015 14:23
-
-
Save setupminimal/470c13a278562b8c6380 to your computer and use it in GitHub Desktop.
A module language that reverses s-expressions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(provide (except-out (all-from-out racket) | |
#%module-begin) | |
(rename-out [module-begin #%module-begin])) | |
(define-syntax-rule (module-begin expr ...) | |
(#%module-begin | |
(eval (reverse-all '(expr ... begin))))) | |
(define (reverse-all item) | |
(if (list? item) | |
(reverse (map reverse-all item)) | |
item)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment