Add :value macro capture designator
Add a new macro_rules matcher, $name:value, with identical semantics to that of a function capture.
That is, it evaluates exactly once at the time of the macro call, and the macro manipulates a named temporary,
identically to how a function call works. Importantly, this extends to the lifetime of temporaries,
which is different from a macro expanding to let name = $name;.
(You can view a rich diff in the Files Changed tab, but apparently only for edited files, not added ones. And I was excited to use a new way to make the rendered link...)
you probably wanted the file to be a .md file as opposed to what it currently is: a file with no extension. Also, the Rendered link should probably link to a file on a git branch, not to a particular commit, since then it will not need to be changed each time you push more commits.
I think POV-Ray's macros may also be prior art: http://www.povray.org/documentation/3.7.0/r3_3.html#r3_3_2_8_3
... I'm tired, obviously. I fixed the file extension 😅 and rendered link
Something I just realized: $:value (as written) forces the macro to evaluate as a block expression. While this is the intent w.r.t. passed in temporaries, it would be nice if $:value could also work for macros intended to be used in statement position (e.g. do not wrap their contents in another block and even potentially expand to let statements and/or items).
For statement position, it might have the correct behavior to bind to a let at the start of the expansion and call drop at the end of the expansion, but I'm not well-versed enough in temporary lifetime promotion to actually know. (I don't think so, as dropping the binding doesn't even do anything if the binding is a Copy reference.)
So while an expression-position expansion can be explained by the match trick, it's currently impossible (as I understand it) to both get fully correct temporary behavior that matches a function call, and expand in statement position.
This RFC has been largely rewritten to use the k#autoref behavior as in RFC #2442.
Closing this as I don't have the bandwidth to shepherd this. Anyone can feel free to borrow wording to revive this, if they're so inclined.