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

Propose implicit named arguments for formatting macros #2795

Merged

Commits on Oct 28, 2019

  1. Configuration menu
    Copy the full SHA
    d1fb492 View commit details
    Browse the repository at this point in the history
  2. Extend discussion around interpolation and prior art

    The RFC itself is not intended to be a way to sneak interpolation
    into the formatting macros; the RFC author believes that they do
    not need full interpolation support, although would not rule it
    out if it was deemed desirable.
    
    This update to the RFC text clarifies the distinction between
    implicit named arguments and interpolation. It also adds a note
    on prior art that Field Init Shorthand is an existing precedent
    where language ergonomics have introduced a special case for
    single identifiers.
    davidhewitt committed Oct 28, 2019
    Configuration menu
    Copy the full SHA
    46efff3 View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2019

  1. Correct PHP string interpolation syntax

    The examples provided had incorrectly merged Scala and PHP.
    Scala's string interpolation is written `s"$foo"` whereas PHP is written `"$foo"`
    davidhewitt authored Oct 30, 2019
    Configuration menu
    Copy the full SHA
    f9b720b View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2019

  1. Fix typos

    With thanks to Lonami, joshtriplett and tmccombs
    davidhewitt committed Nov 3, 2019
    Configuration menu
    Copy the full SHA
    2d44315 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2019

  1. Extend discussion of future work for dotted.paths

    Some discussion in the RFC about how `dotted.paths` might be
    supported, especially in formatting parameters, came to the
    conclusion that a new syntax would very likely be desirable. This
    is added to the future work section and nominally suggests the
    {(expr)} interpolation syntax to achieve this.
    davidhewitt committed Nov 4, 2019
    Configuration menu
    Copy the full SHA
    8ed9a11 View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2019

  1. Configuration menu
    Copy the full SHA
    090b356 View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2019

  1. State precedence of implicit named arguments

    In RFC discussion it emerged that it was not clearly stated in the RFC
    that implicit named arguments only apply if a corresponding explicit
    named argument is not passed to the macro invocation.
    davidhewitt committed Nov 8, 2019
    Configuration menu
    Copy the full SHA
    270bada View commit details
    Browse the repository at this point in the history
  2. Discuss hygiene with format_args!(expr)

    When format_args! recieves an expression as the first argument, it
    attempts to expand it to a string literal. If successful, this is
    used as the format string and format_args! macro expansion continues
    as usual.
    
    This has subtle interactions with macro hygiene when implicit named
    arguments come into play. This commit adds dicussion around this case.
    davidhewitt committed Nov 8, 2019
    Configuration menu
    Copy the full SHA
    1bd2bdc View commit details
    Browse the repository at this point in the history
  3. Add discussion on panic!("{foo}")

    The panic macro currently does not perform string formatting if
    it only passed a single argument which is a string literal.
    
    To be consistent with implicit named arguments and e.g.
    `print!("{foo}")`, panic with a single string literal will need
    to change to also use string formatting.
    davidhewitt committed Nov 8, 2019
    Configuration menu
    Copy the full SHA
    ba36e80 View commit details
    Browse the repository at this point in the history