No way to have + or * as separator token in macros #18700
Open
Description
opened on Nov 6, 2014
I'm trying to write a macro that sums a list of expressions, but it doesn't work because it's not possible to have + or * as the seperator token. For example:
macro_rules! sum {
(
$($e:expr)+ => (
$($e)++ // ???
)
}
It'll interpret is as there being no seperator token, and it seems to just stick a +
at the end. Escaping the first +
doesn't work either.
I'm using rust head
Activity