Skip to content

refactor!: switch variadic spread to postfix syntax#322

Merged
ivov merged 2 commits into
mainfrom
spread-as-postfix
May 6, 2026
Merged

refactor!: switch variadic spread to postfix syntax#322
ivov merged 2 commits into
mainfrom
spread-as-postfix

Conversation

@ivov
Copy link
Copy Markdown
Owner

@ivov ivov commented May 6, 2026

Warning

This is a breaking change!

Switches variadic spread from prefix f(..xs) to postfix f(xs...)

I failed to anticipate parser ambiguity between range and spread: f(..xs) (spread) and f(..5) (range) are identical in the token stream, so the parser reads in spread when it first finds ... This was blocking two of the five range shapes (..N and ..=N) from appearing as inline call arguments to any range-accepting function.

Postfix spread now aligns with Go's callsite syntax and frees .. to be a range operator everywhere.

// before
fmt.Println(..parts)

// after
fmt.Println(parts...)

@ivov ivov merged commit 8f597b2 into main May 6, 2026
12 checks passed
@ivov ivov mentioned this pull request May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Released in lisette-v0.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant