Skip to content

append ...rest - #18218

Merged
fdncred merged 1 commit into
nushell:mainfrom
Dorumin:append-rest
Jun 1, 2026
Merged

fdncred merged 1 commit into
nushell:mainfrom
Dorumin:append-rest

Conversation

@Dorumin

@Dorumin Dorumin commented May 16, 2026

Copy link
Copy Markdown
Contributor

Description

Added rest parameters to append. It still requires the first argument as a foolproofing compile error, like get. If someone really wants the "list wrapping" input behavior, they can | append []

Also nuked one example, and the example list could use some more trimming to have shorter values, and fewer overall. Added one example for the rest values, mixing lists and atomic values, resulting in a net 0.

User-facing changes (Release notes)

append can now take multiple values to append as rest parameters

Additional notes

@Dorumin

Dorumin commented May 16, 2026

Copy link
Copy Markdown
Contributor Author

I find it interesting how Call.rest() can start from 0, so I could simplify logic around that, but starting_pos 1 and a second chain seemed more natural

@Dorumin

Dorumin commented May 16, 2026

Copy link
Copy Markdown
Contributor Author

Are the CI failures sporadic?

@fdncred

fdncred commented May 16, 2026

Copy link
Copy Markdown
Contributor

let's see. i re-ran the failed jobs

@Dorumin

Dorumin commented May 16, 2026

Copy link
Copy Markdown
Contributor Author

Moody runner.

@fdncred

fdncred commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

If you add some tests and an example I'll land this.

@Dorumin

Dorumin commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

It has an example and those are tested as far as I can tell. I replaced one of the examples with one that takes varargs. Do you need module-level tests?

@fdncred
fdncred merged commit dd9f89e into nushell:main Jun 1, 2026
31 of 34 checks passed
@fdncred

fdncred commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

I'm fine with this now. Thanks.

@github-actions github-actions Bot added this to the v0.114.0 milestone Jun 1, 2026
@Dorumin
Dorumin deleted the append-rest branch June 1, 2026 15:30
@fdncred fdncred added notes:ready Indicates Ready for Release notes notes:additions Noted in "Additions" section labels Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notes:additions Noted in "Additions" section notes:ready Indicates Ready for Release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants