Skip to content

SIP-70 - Flexible Varargs #105

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

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

Conversation

lihaoyi
Copy link
Contributor

@lihaoyi lihaoyi commented Feb 28, 2025

No description provided.

```

### Javascript
Javascript's expression `...` syntax works identically to this proposal. In Python, you can mix
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python should be Javascript

@som-snytt
Copy link

On the pattern side, the old gotcha is scala/bug#7623 (which has a lint on Scala 2). That is where two pat vars are satisfied by a single Seq, i.e., there is a kind of misalignment. (The example may temper ambition for patterns.)

@Atry
Copy link
Contributor

Atry commented Mar 6, 2025

Do you want to cite #41 ? There are a lot of previous discussions on this feature.

This SIP is a renamed version of #41 , and also adds an intermediate step to create a temporary seq.

  • applyBegin -> newBuilder
  • applyNext -> addOne
  • applyNextSeq -> addAll
  • applyEnd -> result

@kyouko-taiga kyouko-taiga changed the title SIP-XX - Flexible Varargs SIP-70 - Flexible Varargs Mar 21, 2025
@prolativ
Copy link
Contributor

I started to wander if this SIP could help resolve this issue: scala/scala3#18009
In short, the problem there is that an invocation of a curried method added by a refinement on a subtype of Selectable, e.g.

mySelectable.foo(args1*)(args2*)

should get desugared to something like

mySelectable.applyDynamic("foo")(args1*, args2*).asInstanceOf[Foo]

which is now illegal, but would be when this SIP gets implemented

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

Successfully merging this pull request may close these issues.

7 participants