4 ms·
It can't, I presume code on an older epoch will have to expose it with an alternate name, or upgrade to the new epoch. The epoch RFC doesn't attempt to improve
by Manishearth 9y ago
It can't, I presume code on an older epoch will have to expose it with an alternate name, or upgrade to the new epoch.
The epoch RFC doesn't attempt to improve this, but the hypothetical catch RFC can. It can for example provide an oldcatch!() macro that expands to the catch path instead of the keyword, making it possible to import things or define things. Or have some system of attributes.
Solutions are possible!
- ben0x539 9y agoIs it possible to have a syntax extension (or even macro?) that creates identifiers that wouldn't be legal in plain source code?
- Manishearth 9y agoIt can try to; but it will fail to parse, usually (both macros and new-style syntax extensions go through a sort of re-parse step) Old-style (AST-based, unstable, will go away) syntax extensions can do this. But this isn't relevant, the compiler can define custom syntax extensions that do whatever it wants :)