[racket] local-expand subexpressions

From: Jon Rafkind (rafkind at cs.utah.edu)
Date: Wed Oct 10 19:31:13 EDT 2012

My understanding of local-expand from the documentation is that when the stop-list is not #f that sub-expressions will be expanded but I can't seem to get this to happen.

#lang racket

(define-syntax-rule (bar x) (+ x 1))
(define-syntax (foo stx)
  (syntax-case stx ()
    [(_ expr)
     (printf "~a\n" (syntax->datum (local-expand #'expr 'expression (list #'+))))
     #'1]))


(foo (let () (bar 8)))
(foo (bar 8))

--
Prints

(let-values () (bar 8))
(+ 8 1)

Shouldn't the (bar 8) in the let-values be expanded?

Posted on the users mailing list.