Ants Checkpoint due today (Project Party from 3PM - 5:30PM today in Warren 101B)
HW 5 due two days from now
The Scheme project gets released on Friday; will have a lab to help with getting started next Monday, as well as a lecture this Wednesday to help with understanding interpreters.
The project is a pretty funny mix of content from the end of the course with content from the start of the course
I'm giving a lecture on SQL on August 1st. Please pull up
I will be ending discussion earlier on that day so I can get to Dwinelle on time to get everything prepared
Reminder to finish the mid-semester feedback form
Notes from last section
I like when you give us tips that helped you understand stuff because it often helps me also!
that's very nice to hear
also extends to a lot of you during labs/discussions - if you have a way that you like seeing things that can help you, please also discuss with other people! something that you find helpful can usually really help other people
potato >> all
agreed
i had slivers yesterday cause they had the pizza with potatoes and corn
Notes from last section
If you could travel anywhere in the world (or galaxy), where would you go?
still haven't gone to nyc but i really want to go just cause i want to try good US public transport lol
ive been spoiled by asian city public transport
In the game Kirby Return to Dreamland, inhaling 2 enemies at once causes you to get a randomized ability, and outside of a specific stage, this is the only way to get the UFO Kirby power up, which has a laser attack and allows for infinite flight
what type of conditions do you need to be able to inhale 2 enemies at once? it seems pretty difficult to do, but ive also never played anything kirby related
Temperature Check
Linked Lists
Scheme
Scheme Lists
Would like to mention that I will be talking a lot this discussion at the start cause a lot of this is syntax
What is Scheme
Scheme is another language that you need to learn
It's a dialect of Lisp (List Processor)
Everything is done with recursion
No while/for loops
Good thing about this is that you get a lot of recursion/tree recursion practice with scheme
No mutation in scheme
IMO Scheme is a very good way to demonstrate that once you learn the logic for one programming language, learning a second one is way easier!
There are a lot of parentheses
Why learn scheme
ramble about something anto
Primitives
Scheme has a set of atomic primitive expressions.
Similar to the primitives in Python
These expressions cannot be divided up further
scm> 11
scm> 22
scm> #t
True
scm> #f
False
Booleans (Python)
Remember this table?
Falsey
Truthy
False
True
None
Everything else
0
[], "", (), {}
Booleans (Scheme)
Falsey
Truthy
#f
Everything else
This is something you need to remember
define
In scheme, everything that isn't a primitive is done with prefix notation
(<keyword> [<arguments> ...])
In scheme, we use the define keyword in order to bind values to symbols, which work the same way as variables.
This is also used to define functions - more on this later
This keyword returns the symbol:
In scheme, everything that isn't a primitive is done with prefix notation
(<keyword> [<arguments> ...])
In scheme, we use the define keyword in order to bind values to symbols, which work the same way as variables.
This is also used to define functions - more on this later
This keyword returns the symbol:
>>> x = 3
scm> (define x 3)
x
Intro WWSD (Maybe)
Call Expressions
Call expressions apply a procedure to some arguments
(<operator> [<operands> ...])
Exactly the same process as Python
Evaluate the operator (make sure it's a procedure/function)
Evaluate each of the operands (from left to right)
Apply the operands to the operator
Call Expression WWSD (Maybe)
Call Expressions
>>> add(1, 2)
3
scm> (+12)
3
Important to note that all the operands are evaluated!
Special Forms
They still look like call expressions (syntax-wise), but instead of evaluating all the operators, there are certain rules for evaluation.
Special Forms (if)
(if <predicate> <if-true> [<if-false>])
<predicate> and <if-true> are required, <if-false> is optional
Rule for evaluation:
Evaluate <predicate>
If <predicate> is truthy (don't forget what Scheme does!), evaluate <if-true>
Else evaluate <if-false> (if it exists)
This means that not all of its operands will be evaluated!
I would like to be cooked whole since I don't want to get cut up
fried (2)
I would like to be fried because it would be like a jacuzzi, but I can't decide if I want to be made into french fries, wedges, hasselback, or pave because they all involve getting cut up :(
mashed (2)
scalloped
raw
roasted
made into chips
Mental Health Resources
CAPS:
If you need to talk to a professional, please call CAPS at 510-642-9494.
After Hours Assistance
For any assistance after hours, details on what to do can be found at this link