Page MenuHomePhabricator

Distinguish Formally between Variable Binding and Value Assignment
Open, MediumPublic

Description

When returning an object from the orchestrator, we currently try to resolve any dangling Z18s. If we can't do so (i.e., if an attempt to resolve raises an error), we keep the Z18 intact.

We should constrain the situations in which we permit a Z18 to be returned intact at the top level solely to those situations which satisfy the constraint that all variables be bound. This means that any variable which remains a Z18 in the returned object must have been declared within an enclosing scope.

Event Timeline

For what it's worth, Python doesn't even do this. I can happily define a function

def f(x):
    return y

without receiving any complaint until I call the function. JS is similar, and this is exactly how the function orchestrator works now.

Cory is right, it is very common for dynamically-checked languages to not enforce this.