CS152
Chris Pollett
Sep 29, 2021
const N = 10; ... procedure foo; const M = N; ... N = 20;
(let ((A 1)) ; outer scope, with A defined to be 1 (let ((A 2) ; inner scope, with A defined to be 2 (B A)) ; and B defined to be A B)) ; return the value of B
struct manager; /* declaration */ struct employee { struct manager *boss; struct employee *next_employee; ... }; struct manager { /* definition */ struct employee *first_employee; ... };or
void list_tail(follow_set fs); /* declaration */ void list(follow_set fs) { switch (input_token) { case id : match(id); list_tail(fs); ... } void list_tail(follow_set fs) /* definition */ { switch (input_token) { case comma : match(comma); list(fs); ... }
void foo() { int i=0; i++; { int j, i; j++; } }
void sort_chars(char *a, char *b);which cycles through two char strings a, b. After it is called, for each location i up to the length of the smaller string a[i] will have the smaller of the original values for a[i] and b[i] and b[i] will have the larger value.
n : integer procedure first( ) n := 1 procedure second( ) n : integer first( ) n:=2 if read_integer( ) > 0 //* second( ) else first( ) write integer(n)
fn main() { println!("Hello world!"); }
rustc main.rs
./main
.\main.exe
cargo new hello_project
[package] name = "hello_project" version = "0.1.0" edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies]
authors = ["Me <me@me.com>", "You <you@you.com>", "Others <others@others.com>"] description = "Adds awesome functionality to humdrum program" license = "MyOpenSourceLicenseV1000"
cargo new hello_project --lib
cargo build //or cargo build --debug //default //or cargo build --releases //more optimizations
cargo login cioZqMlHFkfKMhbW39WIkaw7uJ86iGJxgUq
cargo publish
cargo yank -vers 2.0.0and no future projects that use crates.io can depend on that particular version of your project.