-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Propose implicit named arguments for formatting macros #2795
Commits on Oct 28, 2019
-
Configuration menu - View commit details
-
Copy full SHA for d1fb492 - Browse repository at this point
Copy the full SHA d1fb492View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 46efff3 - Browse repository at this point
Copy the full SHA 46efff3View commit details
Commits on Oct 30, 2019
-
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"`
Configuration menu - View commit details
-
Copy full SHA for f9b720b - Browse repository at this point
Copy the full SHA f9b720bView commit details
Commits on Nov 3, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 2d44315 - Browse repository at this point
Copy the full SHA 2d44315View commit details
Commits on Nov 4, 2019
-
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.
Configuration menu - View commit details
-
Copy full SHA for 8ed9a11 - Browse repository at this point
Copy the full SHA 8ed9a11View commit details
Commits on Nov 5, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 090b356 - Browse repository at this point
Copy the full SHA 090b356View commit details
Commits on Nov 8, 2019
-
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.
Configuration menu - View commit details
-
Copy full SHA for 270bada - Browse repository at this point
Copy the full SHA 270badaView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 1bd2bdc - Browse repository at this point
Copy the full SHA 1bd2bdcView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for ba36e80 - Browse repository at this point
Copy the full SHA ba36e80View commit details