Created
July 28, 2021 06:42
-
-
Save shhyou/4d9c2dd007ec8ae4ed1759fc1041484b to your computer and use it in GitHub Desktop.
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/base | |
| (require (for-syntax racket/base) | |
| syntax/parse/define) | |
| (let () | |
| (define-syntax-parse-rule (define-sum S) | |
| (define (S n) | |
| (if (= n 0) 0 (+ n (S (- n 1)))))) | |
| (define-sum sigma) | |
| (sigma 5)) |
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/base | |
| (require (for-syntax racket/base) | |
| syntax/parse/define) | |
| (let () | |
| (define var-in-the-scope "this var is in the scope") | |
| (define-syntax-parse-rule (get-var) | |
| var-in-the-scope) | |
| (get-var)) | |
| (let () | |
| (define-syntax-parse-rule (get-this-too) | |
| also-in-the-scope) | |
| (define also-in-the-scope "this var is also in the scope") | |
| (get-this-too)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment