You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider the following term (where bar is a variable).
foo = bar
foo
When parsed, it's represented as (roughly)
Let (Var "bar") (Abs "foo" (Var "foo"))
It looks a little inside-out, but it means:
Let the next binder be bound to variable "bar"
foo -> foo
All good so far. Now consider
foo = .foo
foo
Here the RHS of the binder refers to a "foo" defined elsewhere. It's similarly parsed as
Let (Var "foo") (Abs "foo" (Var "foo"))
or
Let the next binder be bound to variable "foo"
foo -> foo
Still all good so far. The problem, though, is that when we print this term with its non-recursive let, the syntax doesn't explicitly forbid self-reference. So we end up omitting
foo = foo
foo
which is parsed back as a busted self-reference that's not guarded by a lambda.
Problem 2: variable "resetting"
Consider now a similar situation, but involving a legitimate recursive let. It's a little contrived, but:
foo = do
_ = foo -- to make foo recursive
bar
foo()
Describe and demonstrate the bug
On this hash:
@unison/knn-search-demo/main>
⊙ 1. #htonjt947k
do an
update
with this scratch file,and we get this in the resulting scratch file, which uses the wrong identifier
db
for.db
Screenshots
Environment (please complete the following information):
release/0.5.27
Additional context
The text was updated successfully, but these errors were encountered: