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
| test gist | |
| test test | |
| one two three |
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 | |
| (require mzlib/defmacro) | |
| (provide mac) | |
| (define-for-syntax macros-at-compile-time (make-hash)) | |
| (define-syntax macros-at-run-time | |
| (lambda (stx) |
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
| (mac do args | |
| `((lambda () ,@args))) |
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
| (do (display "using ") | |
| (display "Arc macro\n")) |
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
| using Arc macro |
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/load | |
| (require "mac.rkt") | |
| (mac do args | |
| `((lambda () ,@args))) |
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
| > (do (display "using ") | |
| (display "Arc macro\n")) | |
| using Arc macro |
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
| > (define-syntax-rule (foo) | |
| (do (display "Racket macro ") | |
| (display "using Arc macro\n"))) | |
| > (foo) | |
| Racket macro using Arc macro | |
| > (define-syntax-rule (bar-helper) | |
| (display "Racket macro\n")) | |
| > (mac bar () | |
| `(do (display "Arc macro using ") |
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
| arc> x | |
| Error: reference to undefined identifier: _x | |
| arc> (namespace-set (this-namespace) 'x 123) | |
| nil | |
| arc> x | |
| 123 |
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
| arc> (= other (new-arc)) | |
| #hash((racket-namespace* . #<namespace:0>)) | |
| arc> (namespace-get other 'car) | |
| #<procedure:arc-car> | |
| arc> (namespace-get other 'map) | |
| Error: namespace-variable-value: _map is not defined |
OlderNewer