Created
December 1, 2017 21:59
-
-
Save LeifAndersen/0fe797a827db037a39a5574d1e90ada9 to your computer and use it in GitHub Desktop.
This file contains 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 | |
;; f and g are values defined in the same begin-for-syntax block | |
;; Code compiles succesfully | |
(begin-for-syntax | |
(define (f) g) | |
(define g 42)) | |
;; ====================================== | |
;; f and g are values defined in seperate begin-for-syntax blocks | |
;; Code compiles succesfully | |
#lang racket | |
(begin-for-syntax | |
(define (f) g)) | |
(begin-for-syntax | |
(define g 42)) | |
;; ====================================== | |
;; f is a value, g is a macro, one begin-for-syntax block | |
;; Code compiles succesfully | |
#lang racket | |
(begin-for-syntax | |
(require (for-syntax racket/base)) | |
(define (f) g) | |
(define-syntax g #'42)) | |
;; ====================================== | |
;; f is a value, g is a macro, defined in begin-for-syntax blocks | |
;; Code fails to compile | |
#lang racket | |
(begin-for-syntax | |
(require (for-syntax racket/base)) | |
(define (f) g)) | |
(begin-for-syntax | |
(define-syntax g #'42)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment