Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destructuring #473

Merged
merged 32 commits into from
Dec 16, 2021
Merged

Destructuring #473

merged 32 commits into from
Dec 16, 2021

Conversation

francois-caddet
Copy link
Contributor

@francois-caddet francois-caddet commented Nov 23, 2021

relate to #81
Full implementation of the record destructuring as described in #81 . The list destructuring is not implemented yet.
Typechecking is not performed at this time. will be done in future PR

bugged... probably due to a gramar issue
now it's in the correct order as described in the issue
Also added the default (`?`) in the gramar but ignored by the interpreter
works, should be tested (add cases in the testsuite)
now `fold` the matches. Code is cleaner and a bit more efficiant
NOTE: new dev dependancy (duplicate) to avoid duplication of code in the test suite.  Check `tests/destructuring.rs` for an example.
@github-actions github-actions bot temporarily deployed to pull request November 23, 2021 12:38 Inactive
@github-actions github-actions bot temporarily deployed to pull request November 23, 2021 13:18 Inactive
Copy link
Member

@yannham yannham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM globally, but I left a good chunk of comments and nitpicks. Also, your tests always start with an empty line, for some reason.

The more I think about it, and the more I imagine we will want to have strict checks instead of relying on lazy contracts for pattern matching, for early error reporting. But we decided to go this route because this was easier, and for now, this will do.

src/destruct.rs Show resolved Hide resolved
src/transformations.rs Outdated Show resolved Hide resolved
Cargo.lock Outdated Show resolved Hide resolved
src/transformations.rs Outdated Show resolved Hide resolved
src/transformations.rs Outdated Show resolved Hide resolved
src/transformations.rs Show resolved Hide resolved
src/transformations.rs Outdated Show resolved Hide resolved
src/transformations.rs Outdated Show resolved Hide resolved
src/typecheck/mod.rs Show resolved Hide resolved
tests/common.rs Show resolved Hide resolved
francois-caddet and others added 2 commits December 10, 2021 15:55
cleaning

- doc clarification
- remove useless `.clone()`
- Mor clear name for `QuestionMark` tocken

Co-authored-by: Yann Hamdaoui <yann.hamdaoui@gmail.com>
@github-actions github-actions bot temporarily deployed to pull request December 10, 2021 15:17 Inactive
- Doc improvements.
- Code cleaning.
- Drop some useless values clones.
- rename `drop_fields` to `bind_open_field` more meaningfull name
@github-actions github-actions bot temporarily deployed to pull request December 14, 2021 13:30 Inactive
@francois-caddet francois-caddet marked this pull request as ready for review December 14, 2021 13:39
@github-actions github-actions bot temporarily deployed to pull request December 15, 2021 08:32 Inactive
now a top level let can not be a `Pattern` anymore. if you write a pattern, the repl wil wait for the folowing part of a standart `let ... = ... in ...` expression.

Also clean the metavalue generation for default annot.
@github-actions github-actions bot temporarily deployed to pull request December 15, 2021 14:04 Inactive
@github-actions github-actions bot temporarily deployed to pull request December 15, 2021 14:26 Inactive
@github-actions github-actions bot temporarily deployed to pull request December 15, 2021 14:41 Inactive
@github-actions github-actions bot temporarily deployed to pull request December 16, 2021 14:30 Inactive
@github-actions github-actions bot temporarily deployed to pull request December 16, 2021 18:01 Inactive
@francois-caddet francois-caddet merged commit b05aa1a into master Dec 16, 2021
@francois-caddet francois-caddet deleted the feature/pattern_matching branch December 16, 2021 21:22
@yannham yannham mentioned this pull request Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants