-
-
Notifications
You must be signed in to change notification settings - Fork 71
Description
I've previously discussed this with @mflatt , but I figure I should make a ticket.
Consider this program:
#lang rhombus/and_meta
block:
let x = "outer"
defn.macro 'm $id':
'let $id = "inner"
x'
m x
It returns "inner", but I think it should return "outer" like the similar Racket program does:
(define x "outer")
(define-syntax-rule (m id)
(let ([id "inner"])
x))
(m x)
I want to point this out now because I saw racket/racket#4929, which proposes to add something new to the syntax-local- zoo to support the implementation of Rhombus let. I'm a little skeptical of the current implementation strategy for let given that it gets this use-site binder hygiene wrong, and it feels like it'd be unfortunate to expose more low level syntax-local- operations that could point users towards implementations of scoping structures that don't get hygiene right.
In contrast, an implementation of let using definition contexts and local-expand should be able to avoid this problem because one of the things definition contexts encapsulate is a set of local use-site scopes. I don't know enough about Rhombus to know what other implementation constraints there are, though.