See Array.prototype.fill. When used like this in JavaScript:
It will yield the following output:
It seems to me that solidity-generators would be the right place to implement such a functionality in Solidity (better than forge-std).
The way I see it, there are a couple ways this could be implemented:
- Add a new function
fill that does only this.
- Modify the behavior of
linspace to continue filling the output with duplicated values of the second argument (ustop).