Last active
April 3, 2019 19:31
-
-
Save iafisher/9f800cd6de39d6e9af40025eefe54de2 to your computer and use it in GitHub Desktop.
Minimal example of local-expand not turning lambda into #%plain-lambda in Racket
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 | |
(define-syntax (show stx) | |
(syntax-case stx () | |
[(_ x) | |
(let ([fully (local-expand #'x 'expression #f)]) | |
(displayln (syntax->datum fully)) | |
#'x)])) | |
; expect to see (#%plain-lambda (x) x), but get (lambda (x) x) instead | |
; docs for fully-expanded Racket: https://docs.racket-lang.org/reference/syntax-model.html#(part._fully-expanded) | |
(show (lambda (x) x)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment