You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the integer identifiers used for indexing cases in the case! macro correspond to type parameters passed to the Case<const N: usize> trait. This makes it a bit inconvenient to name the case identifiers with anything other than usize literals. But there is a way we can get around this, by generating macros that convert identifiers into usize tokens:
Unfortunately there's a large snag with this approach; macros in "path-based" scope will ALWAYS live in the crate root where they are defined. As a result, punning modules and types and getting the kind of scope punning we want does not work. Some kind of bespoke name mangling inside the case! macro might work; or, we might have to make the concept of "matcher" or "case address"/"indexing" macros more first-class.
The text was updated successfully, but these errors were encountered:
Currently, the integer identifiers used for indexing cases in the
case!
macro correspond to type parameters passed to theCase<const N: usize>
trait. This makes it a bit inconvenient to name the case identifiers with anything other thanusize
literals. But there is a way we can get around this, by generating macros that convert identifiers intousize
tokens:Unfortunately there's a large snag with this approach; macros in "path-based" scope will ALWAYS live in the crate root where they are defined. As a result, punning modules and types and getting the kind of scope punning we want does not work. Some kind of bespoke name mangling inside the
case!
macro might work; or, we might have to make the concept of "matcher" or "case address"/"indexing" macros more first-class.The text was updated successfully, but these errors were encountered: