The start-of-class algorithm
Approximate overview
Warning! You are being recorded (and transcribed) (provided the technology is working correctly).
Guidelines
Scholarly
Artistic/Cultural
Multicultural
Peer
Musical, theatric, sporting, academic, and similar events involving this section’s students are welcome.
Wellness
Misc
These do not earn tokens, but are worth your consideration.
For the handwritten notes allowed on each Learning Assessment, can we make a one-page reference sheet with whatever information we find helpful, similar to a cheat sheet?
That’s the goal.
Where are the readings?
Linked on the schedule.
Why wouldn’t Scamper let me make circles?
You have to type some extra things to make circles. We’ll cover it in lab today.
What will the learning assessments look like?
You will get a problem on a sheet of paper and answer it.
Examples are posted on the course web site.
Will Sam ever learn to pronounce Drilon’s name?
Odds are against it.
Given a bunch of people, each of whom has a playing card, assemble people with the same playing card value.
How could you do that better? (TPS)
How many types of values (e.g. numbers, strings, lists) are there in Scheme? And what are they?
There are a lot. And programmers can design new ones. For example, while “standard” Scheme does not include images or sounds, we’ve designed and implemented those types.
Do numbers type in Scheme only include integers, or integers and real, or just any number in existence?
It depends on the variant of Scheme. Racket separates integers and real numbers, as well as exact (arbitrary precision) and inexact (approximated, like in most languages). Racket also supports complex numbers. Scamper treats everything as a real number, but can tell when the real is an integer (at least it usually can).
Can you go over the questions from the Scheme reading?
We’re going to have you go over the questions with your partner, try them on the computer, and then you can ask us questions.
Can you further explain what does this mean: “As we noted, the string-split operation returned a list, an ordered collection of values. Note that, like expressions, lists are surrounded by parentheses. Scheme distinguishes lists, which should not be evaluated, from expressions, which should be evaluated, by putting the word list at the start of the parenthesized expression.”
Parentheses can mean two different things in Scheme: Usually, they mean “Please apply this function to these inputs”. However, in the case of lists, they also mean “These are the elements of the list.” Does that clarify it?
(+ 3 2)- means apply the operation
(list 1 2 3)- means “this is a list”
(list (+ 1 2) (+ 3 4))- means “evalate all the operands and then make a list”
Is a list of strings one parameter or several parameters?
Just one thing. It’s just a list.
How do I write an arithmetic calculation in Scheme involving a negative number?
Precede the number with a dash (negative sign), as in
(* -2 3).
What is the main difference between using the Definitions pane and the Interactions (REPL) pane in Scamper, and when should we use each one?
I tend to use the definitions pane for things I plan to keep and the interactions pane for quick experiments. YMMV.
I have a question about “string-split”. Could the second argument be a number instead of a string, with the number indicating how many characters to include before splitting the string? For example, could a number specify that the string should be split every 5 characters?
Nope. I don’t recall whether we have a different procedure that does that. If not, we can write one. (Well, I can write one. You’ll know how to write such a procedure by the middle of the semester.)
Please elaborate on subroutines. I didn’t really understand from the readings.
A subroutine (also “procedure” or “function”) takes a set of code and puts it together into something we can refer to by name. For example,
string-lengthis a subroutine that computes the length of a string. (In this case, we don’t know what the underlying instructions are. Starting Wednesday, you’ll know how to write your own.)
How useful is it to distinguish procedure/function/parameter/argument especially if going further in CSC?
It’s useful to distinguish procedure/function from parameter/argument. The first pair are sets of instructions to accomplish a task. The second pair are the inputs to those instructions. Most computer scientists are remarkably casual about the difference between a function and a procedure, as well as between a parameter and an argument, and tend to use the terms interchangeably.
Each partner should do lab one.
I apologize for the not-quite-right instructions for setting your default page.
Ignore the mention of DrRacket in the lab.
You may not finish. That’s okay. There’s nothing to turn in.
Please try to finish on your own.
On your way out, throw the lab in the recycling bin.