This will be a living document where I will ocassionally add new "gotchas" I discover with Rust. Do note that I am still learning Rust. I mean, who isn't?
8 May 2021.
Dear diary,
| mod borrow_method { | |
| use std::borrow::{Borrow, BorrowMut}; | |
| pub struct Inner { | |
| x: i32, | |
| } | |
| impl Inner { | |
| pub fn new() -> Self { | |
| Inner { x: 0 } | |
| } |
E R N E S T W O N G
ERNEST
| #!/usr/bin/env bash | |
| declare -A myarray | |
| myarray["'"]="yes" | |
| echo ${!myarray[@]} | |
| echo ${myarray["'"]} | |
| [[ -v myarray["'"] ]] && echo yes || echo no # Expected: "yes" printed. Actual: "no" printed. | |
| # Tested on GNU bash version 4.4.20(1)-release |
| 7282 | |
| Pass 2 - terminal vocab - #7283 | |
| Pass 2 - terminal vocab - #7284 | |
| Pass 2 - terminal vocab - #7285 | |
| Pass 2 - terminal vocab - #7286 | |
| Pass 2 - terminal vocab - #7287 | |
| Pass 2 - terminal vocab - #7288 | |
| Pass 2 - terminal vocab - #7289 | |
| Pass 2 - terminal vocab - #7290 | |
| Pass 2 - terminal vocab - #7291 |
| /home/ernwong/anaconda3/envs/NL2code/bin/python /home/ernwong/Downloads/Software/PyCharm/pycharm-professional-2020.1.1/pycharm-2020.1.1/plugins/python/helpers/pydev/pydevconsole.py --mode=client --port=35069 | |
| import sys; print('Python %s on %s' % (sys.version, sys.platform)) | |
| sys.path.extend(['/home/ernwong/uni/se700/part4project/NL2code']) | |
| PyDev console: starting. | |
| Python 2.7.17 |Anaconda, Inc.| (default, Oct 21 2019, 19:04:46) | |
| [GCC 7.3.0] on linux2 | |
| >>> import os |
| /home/ernwong/anaconda3/envs/NL2code/bin/python /home/ernwong/Downloads/Software/PyCharm/pycharm-professional-2020.1.1/pycharm-2020.1.1/plugins/python/helpers/pydev/pydevconsole.py --mode=client --port=44163 | |
| import sys; print('Python %s on %s' % (sys.version, sys.platform)) | |
| sys.path.extend(['/home/ernwong/uni/se700/part4project/NL2code']) | |
| PyDev console: starting. | |
| Python 2.7.17 |Anaconda, Inc.| (default, Oct 21 2019, 19:04:46) | |
| [GCC 7.3.0] on linux2 | |
| >>> runfile('/home/ernwong/uni/se700/part4project/cpp_parser.py', wdir='/home/ernwong/uni/se700/part4project') |
| Tokens | From below | From horizontal | From above | To below | To horizontal | To above |
|---|---|---|---|---|---|---|
+ |
Yes ✔️ | Yes ✔️ | Yes ✔️ | Yes ✔️ | Yes ✔️ | Yes ✔️ |
< |
No ❌ | Yes ✔️ | No ❌ | Yes ✔️ | Yes ✔️ | Yes ✔️ |
> |
Yes ✔️ | Yes ✔️ | Yes ✔️ | No ❌ | Yes ✔️ | No ❌ |
.,_ |
Yes ✔️ | Yes ✔️ | No ❌ | Yes ✔️ | Yes ✔️ | No ❌ |
'`^* |
No ❌ | Yes :hea |
Ideally we want the following behaviour:
Essential components: