Skip to content

tracking issue for ? macro repetition #48075

Closed

Description

@nikomatsakis

RFC: rust-lang/rfcs#2298

Status

Known bugs

None.

Unresolved questions to be answered before stabilization

  • Should the ? Kleene operator accept a separator? Adding a separator is completely meaningless (since we don't accept trailing separators, and ? can accept "at most one" repetition), but allowing it is consistent with + and *. Currently, we allow a separator. We could also make it an error or lint.

Activity

  1. added
    T-langRelevant to the language team
    B-unstableBlocker: Implemented in the nightly compiler and unstable.
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    on Feb 8, 2018
  2. nikomatsakis commented on Feb 8, 2018

    @nikomatsakis
    ContributorAuthor
  3. mark-i-m commented on Feb 17, 2018

    @mark-i-m
    Contributor

    @nikomatsakis Could you update the checklist? The preliminary impl is available on nightly.

  4. mark-i-m commented on Feb 27, 2018

    @mark-i-m
    Contributor

    @Centril I think you need to update the tracking issue in the RFC, too 😛

  5. Centril commented on Feb 27, 2018

    @Centril
    Contributor

    @mark-i-m Already done 🤣

  6. clarfonthey commented on Mar 28, 2018

    @clarfonthey
    Contributor

    Is there any plan to stabilise this soon?

  7. mark-i-m commented on Mar 28, 2018

    @mark-i-m
    Contributor

    I think it depends on experience if this is the right way to solve the problems involved... Frankly, I haven't really written any macros since I implemented this 😛 ...

    I think there is still the one problem that was pointed out in the RFC thread: this doesn't provide a clean solution for trailing commas in * macros, since you would end up accepting foo!{,} which is a bit weird.

    We could conceivably stabilize this anyway if people find it really useful. Any thoughts?

  8. clarfonthey commented on Mar 28, 2018

    @clarfonthey
    Contributor

    I personally see it more ergonomic to have rules for () and $(...),+ $(,)? than $(...),* and $(...,)*, as the former usually requires way less duplication than the latter. The former it also natural for recursive macros, and it basically solves the trailing comma problem nicely.

    Considering how it also allows optional arguments as well, I think it's pretty much a win here.

  9. clarfonthey commented on Mar 28, 2018

    @clarfonthey
    Contributor

    As far as the one unresolved question (following separators) goes, I'm in favour of allowing it for the sake of a simpler grammar, but linting it in rustc (not clippy). That seems pretty ergonomic to me, and the compiler internally would have to accept it with a separator anyways to provide useful error messages.

  10. 87 remaining items

  11. rfcbot commented on Nov 20, 2018

    @rfcbot

    🔔 This is now entering its final comment period, as per the review above. 🔔

  12. added
    final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.
    and removed
    proposed-final-comment-periodProposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.
    on Nov 20, 2018
  13. Centril commented on Nov 23, 2018

    @Centril
    Contributor

    @mark-i-m Since you did the implementation work, could you prepare a PR for the stabilization as well? :)

  14. mark-i-m commented on Nov 23, 2018

    @mark-i-m
    Contributor

    Sure, but it might be a few days before I can get to it

  15. Centril commented on Nov 23, 2018

    @Centril
    Contributor

    @mark-i-m Ah; there's no great rush; 1.32 goes into beta on the 7th. Do you think you can get it landed by then?

  16. mark-i-m commented on Nov 24, 2018

    @mark-i-m
    Contributor

    Yeah, I think I could do it by the end of the week.

  17. added a commit that references this issue on Nov 29, 2018
  18. mark-i-m commented on Nov 29, 2018

    @mark-i-m
    Contributor

    #56245 has merged

  19. added and removed
    final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.
    on Nov 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-unstableBlocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-langRelevant to the language teamdisposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions