Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

20221217 assign #103

Merged
merged 42 commits into from
Aug 16, 2023
Merged

20221217 assign #103

merged 42 commits into from
Aug 16, 2023

Conversation

prozacchiwawa
Copy link

@prozacchiwawa prozacchiwawa commented Dec 22, 2022

this creates an "assign" form that performs destructuring and binding a lot like let, but with simpler and more versatile syntax.

(mod (X)
  (include *standard-cl-21*)
  (defun-inline tup (X Y) (c X Y))
  (assign
    (X1 . X2) (tup (+ X 1) (+ X 2)) ;; 14
    X3 (+ X1 1) ;; 15
    X4 (+ X2 1) ;; 16
    (Y0 . X5) (tup (+ X4 1) (+ X4 1)) ;; 17
    X6 (+ Y0 1) ;; 18
    Y1 (+ X6 Y0) ;; 35
    Y1
    )
  )

Ordering is done automatically and the bindings are broken up into a stack of parallel let forms.

src/compiler/frontend.rs Outdated Show resolved Hide resolved
@prozacchiwawa prozacchiwawa added bug Something isn't working and removed Ready labels Feb 7, 2023
@prozacchiwawa
Copy link
Author

Need to add additional tests in here, bug based on feedback.

@prozacchiwawa
Copy link
Author

not actually a bug but adding tests surrounding this.
i'm going to push strict mode harder.

@prozacchiwawa
Copy link
Author

https://github.com/Chia-Network/clvm_tools_rs/pull/124 <-- this bug was found, which is unrelated to this code, but is exercised by it.

@prozacchiwawa prozacchiwawa removed the bug Something isn't working label Feb 8, 2023
@coveralls-official
Copy link

coveralls-official bot commented May 17, 2023

Pull Request Test Coverage Report for Build 5881942962

  • 262 of 325 (80.62%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 78.524%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/compiler/codegen.rs 74 76 97.37%
src/compiler/comptypes.rs 34 41 82.93%
src/compiler/frontend.rs 60 68 88.24%
src/compiler/evaluate.rs 31 52 59.62%
src/compiler/rename.rs 26 51 50.98%
Totals Coverage Status
Change from base Build 5871842780: 0.04%
Covered Lines: 7499
Relevant Lines: 9550

💛 - Coveralls

@prozacchiwawa prozacchiwawa merged commit 62eaade into base Aug 16, 2023
25 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants