Lecture 1: Introduction to Research — [📝Lecture Notebooks] [
Lecture 2: Introduction to Python — [📝Lecture Notebooks] [
Lecture 3: Introduction to NumPy — [📝Lecture Notebooks] [
Lecture 4: Introduction to pandas — [📝Lecture Notebooks] [
Lecture 5: Plotting Data — [📝Lecture Notebooks] [[
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To | From | Method | |
---|---|---|---|
string of code | literal code | std::stringify!{} | |
string of code | syntax tree | !quote(#syntax_tree).to_string() | |
string of code | TokenStream | .to_string() | |
string of syntax | literal code | format!("{:?}",parse2::<SynType>(quote! {...}).expect(...) | |
string of syntax | syntax tree | format!("{:?}"),…), format!("{:#?}"),…) | |
string of tokens | literal code | format!("{:?}",quote! {...}) | |
string of tokens | TokenStream | format!("{:?}"),…), format!("{:#?}"),…) | |
syn::Error | TokenStream | .to_compile_error() [see Rule #7] | |
syntax tree | literal code | parse_quote!(…) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let mut s1 = String::from("Hello"); | |
let s2 = &mut s1; | |
s2.push('!'); | |
// change order of next tow lines and program will not compile | |
println!("s2 :{}", s2); | |
println!("s1 :{}", s1); |