Skip to content

2024-08-14

2024 August 14 (Wednesday)

  • Arose at 05:20 for morning prayer.

  • Patrick joined me.

  • Drove to LCC and walked into the building, but then realized that I did not have my gear for climing.

  • It was not in the Subaru, which I had driven to LCC.

  • So I drove back home and gave up on climbing today.
  • At least I had remembered to take my gear out of the Camry.
  • Finding my shoes and chalk-bag in my bedroom, I moved the into the Subaru so that I'll have them when I drive to LCC on Friday morning.

  • When taking out the garbage at Picket, I put all of the broken-down cardboard boxes into one or the other of the bins.

  • Getting close to finishing Isaacson's biography of Einsten.

  • About an hour left after the trip home from LCC.

  • Last night, I read a bit again from the beginning of Hazony.

  • I reviewed the passage in which he indicates that he will not in Conservatism: A Rediscovery indicate why he objects to the Catholic view of conservatism as respect for the natural law as put forth by Aquinas.

  • I looked for and did not find Hazony's summary of his position, the detail of which I have forgotten.
  • What I seem to remember is only that Hazony shuns every prescriptive or ideological view in a certain broad category, but I don't remember anything more precise than that.

  • Worked on guessing game for rust.

  • It is neat, that

    cargo doc --open
    
    "will build documentation provided by all your dependencies locally and open it in your browser."

  • Looking at the documentation for rand (0.8.5), I see that the
    use rand::Rng;
    
    near the top of main.rs uses a "trait" defined in rand.
  • A trait seems to be a collection of methods.
  • I found that I could instead do
  • rust use rand::{thread_rng, Rng}; to use both the top-level method thread_rng and the trait Rng, which provides the gen_range method as a member of the thing returned by thread_rng()
  • After finishing the guessing game, the appearance of num in the match-construct seems mysterious to me.
    let guess: u32 = match guess.trim().parse() {
      OK(num) => num,
      Err(_) => continue,
    };
    
    num is nowhere defined.
  • I verified that one can type any identifier rather than num.

  • Started reading Chapter 3 of the rust-book.

  • In Appendix A, there is the neat idea of a raw identifier.
    • The raw identifier is a keyword that is used nevertheless as an identifier, by way of the r# prefix.
    • This allows the symbol in the binary to have the same name as a keyword.
    • For example one can call a function in a library compiled in a different language, when an external function-name of the library has the same identifier as a keyword in rust.
  • Started 3.1.
  • A const value is a constant expression and can be declared even in the global scope.
    • The type must be annotated for a const value.
  • Read 3.2.