Repository navigation
[docs] Document the unroll_for! expression in the DSLX reference - #5334
Closed
amalsaidov wants to merge 1 commit into
Closed
amalsaidov wants to merge 1 commit into
amalsaidov wants to merge 1 commit into
Conversation
`unroll_for!` appears in the DSLX keyword table and is used throughout the tutorials and modules, but it was never documented in the DSLX reference. Add an `unroll_for!` section next to the `for` expression section describing its compile-time full-unrolling semantics, how it evolves an accumulator like `for`, the constexpr loop index that enables proc spawning / channel-array indexing / `assert_fmt!` labels, its syntax, and examples. Docs only; no behavior change. Fixes google#1708 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Contributor
|
Seems duplicative of #5234 |
Author
|
Closing this one on my side — thanks for taking a look 🙏 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds documentation for the
unroll_for!expression to the DSLX reference(
docs_src/dslx_reference.md), in a new section next to the existingforexpression section.
Why
Fixes #1708.
unroll_for!is listed in the DSLX keyword table and isused throughout the tutorials (e.g.
how_to_use_procs.md) and modules, but ithad no reference documentation under
https://google.github.io/xls/dslx_reference/.
Details
The new section follows the structure and style of the adjacent
fordocumentation (prose + Syntax + Examples) and covers:
of the body per iteration), so the iteration count must be known at compile
time.
for, it is an expression that evolves an accumulator andevaluates to its final value, using the same trailing-argument syntax.
forcannot:spawning procs, indexing arrays of channels, and building unique
assert_fmt!labels (with a pointer to the Procs tutorial).
Semantics were drawn from the frontend AST (
ConstFor/unroll_for!) andexisting usages in the tree. Docs only; no behavior change.
🤖 Generated with Claude Code