-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Complete tuple destructuring with complex splatted left hand sides
The flisp implementation has several arguable-bugs here which allow us to observe some assignments before all side effects of the right hand side have occurred. For example (x, y) = (1, undefined) assigns to `x` before throwing the `UndefVarError`. As another example, let f() = (x = 100) (x, y) = (1, f()) x end leaves `x` with the value of 100 in the existing implementation. Both these examples violate the principle that symbolic simpification should not be observable. As a fix, we now assign the right hand sides to temporary variables and do this even for normal identifiers on the right hand side, ensuring the normal left-to-right evaluation order for function arguments on the right hand side.
- Loading branch information
Showing
5 changed files
with
319 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.