Skip to content

Instantly share code, notes, and snippets.

@iafisher
Last active April 3, 2019 19:31
Show Gist options
  • Save iafisher/9f800cd6de39d6e9af40025eefe54de2 to your computer and use it in GitHub Desktop.
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
#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