3 ms·
Could you maybe whip up an example on https://play.rust-lang.org/ https://play.rust-lang.org/ ? It's not 100% clear to me what you're doing here, but I'm intere
by steveklabnik 7y ago
Could you maybe whip up an example on https://play.rust-lang.org/ https://play.rust-lang.org/ ? It's not 100% clear to me what you're doing here, but I'm interested!
- sdegutis 7y agoThink for example of implementing a list interpreter. In certain situations, you know for a fact that an AST node is a given type. So you just want to cast from Node to Node::Symbol(s) to extract that std::string::String out of it. RFC #2593 seems like it would help here, and is something I've wanted for similar but unrelated reasons. So in the meantime I made poor_mans_cast!() macro to do this, which I've used twice already.