Skip to content
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

Multiple assignment list unwrapping #509

Open
dlrobertson opened this issue Dec 13, 2022 · 0 comments
Open

Multiple assignment list unwrapping #509

dlrobertson opened this issue Dec 13, 2022 · 0 comments

Comments

@dlrobertson
Copy link
Member

Summary

Similar to #508, it would be nice to be able to assign multiple variables from a list in a single unwrapping statement.

Example

strictly split returns a list, but in cases like validate and extract, populating local variables with indexing leads to text that is a bit verbose. We currently have something like the following steps:

  1. Let splitResult be the result of running strictly split given qualifiedName and U+003A (:).
  2. Set prefix to splitResult[0].
  3. Set localName to splitResult[1].

With something like #508 for list we could simplify these three steps into something like the following:

  1. Set « prefix, localName » to the result of running strictly split given qualifiedName and U+003A (:).

Context

Originally posted by @annevk in #508 (comment)

I think in particular for strictly split it would be helpful if this worked on list-likes as well (the let-side could still use the tuple syntax I suppose), but maybe we ought to tackle that separately.

Also related to whatwg/dom#1134.

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

No branches or pull requests

1 participant