4 ms·
> "The local variable is called krate because crate is a keyword" This is an interesting solution to a problem I often face (whenever I write a tool to in envi
by tomerv 10y ago
> "The local variable is called krate because crate is a keyword"
This is an interesting solution to a problem I often face (whenever I write a tool to in environment X to process something for environment X) . Is this a common way to handle this problem? I don't think I've seen this before.
- steveklabnik 10y agoYes. In Ruby, 'class' is a keyword, so most people use 'klass', for example. The other one that comes up in Rust is 'type', people tend to use 'ty'.
- wink 10y agoThe Java version used to be 'klass' and 'clazz' - haven't seen it in a few years though.
- Manishearth 10y agoI've seen it crop up quite often in JNI code (also code that uses reflection)