racket / rhombus

Rhombus programming language
Other
344 stars 62 forks source link

Eager expansion of definitions’ right-hand sides can be detected #472

Open usaoc opened 9 months ago

usaoc commented 9 months ago

For example, this program

#lang rhombus
block:
  def a:
    b
  def b = #false
  #false

makes the reference to b a syntax error, while this program

#lang rhombus
block:
  def a:
    #false
    b
  def b = #false
  #false

is a run-time exception, like the Racket counterpart.

mflatt commented 4 months ago

Just for the record, this trade-off is also described at https://github.com/mflatt/rhombus-prototype/blob/rhombus/rhombus/0000-rhombus.md#propagating-static-information. I think the current choice has worked ok in practice, but it seems like it will always be an issue.