-
Notifications
You must be signed in to change notification settings - Fork 237
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
feat: array concat method #7199
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20
.
Benchmark suite | Current: d161a0d | Previous: 4fe4cc6 | Ratio |
---|---|---|---|
sha256_regression |
0.076 s |
0.051 s |
1.49 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
🚀 Deployed on https://6798c902499a601606e87260--noir-docs.netlify.app |
|
||
```rust | ||
fn concat<let M: u32>(self, array2: [T; M]) -> [T; N + M] | ||
``` | ||
|
||
```rust | ||
fn main() { | ||
let arr1 = [1, 2, 3, 4]; | ||
let arr2 = [6, 7, 8, 9, 10, 11]; | ||
let concatenated_arr = arr1.concat(arr2); | ||
assert(concatenated_arr == [1, 2, 3, 4, 6, 7, 8, 9, 10, 11]); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you snippet-ify this like in the aztec docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't tell if you had some kind of clever code snippet stuff in the Noir repo, so I hand-wrote this. Do you have something? Or are you asking if it'd be possible to set something up like the snippet-ifying that we do in aztec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We pulled across the same snippet code that you added to the aztec-packages docs a while back. You can use the exact same syntax as in the aztec docs to insert snippets of noir code into the docs here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps that's one for a separate, dedicated PR, because I don't think any of noir_stdlib/src/array/mod.nr
is using that code snippet tool yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @noir-lang/developerrelations on Noir doc changes. |
Description
Add a
concat
method to the stdlib for the array type.Where are the array tests? Where should I put a test for this method? Edit: I've put the test in the same file (despite not seeing tests for the other array methods there)
Problem*
Summary*
Additional Context
Documentation*
Check one:
PR Checklist*
cargo fmt
on default settings.