rhombus-prototype
rhombus-prototype copied to clipboard
A `let` before another `def` in the same block
(Found during the writing of e7dc0d9; opening for public attention)
Currently, a let can “scope over” another def in the same block:
#lang rhombus
block:
let x = "outer"
def x = "inner"
// refers to the `let` binding, i.e., "outer"
x
This is because the let binding has an extra scope (in order to achieve “forward definition”) compared to the def binding. Is this a reasonable behavior? And in general, how should let and def interact within the same block?
I think either an error or "inner" are acceptable behaviors here.
Made an error in bfbb0975096f34a8bbe9e566ce912555427a114a