This file contains hidden or 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
| #lang racket | |
| ;; CIS352 'S26 Lecture Notes -- Introduction to the Untyped λ-Calculus | |
| ;; ☐ The Untyped λ-Calculus | |
| ;; ☐ β-reduction | |
| ;; ☐ λ-calculus Semantics and Normal Forms | |
| ;; Today we will learn about one of the most central aspects of the | |
| ;; course: Alonzo Church's untyped λ-calculus. The λ-calculus is not |
This file contains hidden or 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
| #lang racket | |
| ;; CIS352 -- Feb 24, 2026 | |
| ;; □ -- Sets in Racket | |
| ;; QuickAnswer | |
| (set) ;; empty set | |
| (set 1 2 3) ;; {1, 2, 3} = {3, 2, 1} = {3, 3, 2, 2, 1, 1, 1} |
This file contains hidden or 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
| #lang racket | |
| ;; CIS352 -- Feb 18, 2026 | |
| ;; Consider watching this lecture video on foldr: | |
| ;; https://www.youtube.com/watch?v=WUAI_v110NQ&list=PLXaqTeMx01E_eK1ZEpKvKL5KwSaj7cJW9&index=15 | |
| (define (count-evens? l) | |
| (foldr (lambda (next-elt acc) (if (even? next-elt) (+ 1 acc) acc)) | |
| 0 |
This file contains hidden or 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
| #lang racket | |
| ;; CIS352 -- Practice on Pattern Matching | |
| ;; | |
| ;; If you want more practice, I have a video here: https://www.youtube.com/watch?v=RJFkmh9Wo8o | |
| (define (filter f l) | |
| (if (empty? l) | |
| '() | |
| (cons (f (first l)) (filter f (rest l))))) |
This file contains hidden or 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
| #lang racket | |
| ;; CIS352 -- Spring 2026 | |
| ;; Today's agenda... | |
| ;; □ -- Evaluation Order | |
| ;; □ -- Printf-style debugging and reachability hypotheses | |
| ;; □ -- Evaluation of function call | |
| ;; □ -- The Stack | |
| ;; □ -- Tail Position and Tail Calls |
This file contains hidden or 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
| #lang racket | |
| ;; CIS352 -- The Algebra of Programming | |
| ;; Spring 2026 -- Kristopher Micinski | |
| ;; Introduction: | |
| ;; | |
| ;; Students often ask (in CIS352): "why learn Racket, a language with | |
| ;; an arcane syntax that I might not use outside of this class?" It is | |
| ;; a very reasonable question, and today we will answer it directly: |
This file contains hidden or 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
| #lang racket | |
| ;; CIS352 -- Feb 3, 2026 | |
| ;; Pattern matching: | |
| ;; □ -- Trees, manually | |
| ;; □ -- Recursion over trees | |
| ;; □ -- Introducing pattern matching | |
| ;; □ -- Matching list patterns ("quasipatterns") | |
| ;; □ -- Matching predicate patterns | |
| ;; □ -- Trees, and algebraic data types generally |
This file contains hidden or 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
| #lang racket | |
| ;; CIS 352 -- Spring 2026 | |
| ;; 1/27/26 (I believe) | |
| ;; quickanswer.harp-lab.com | |
| ;; the define form lets us define funcitons | |
| ;; (define (f x y z) e-body) | |
| (define (both-even? n0 n1) |
This file contains hidden or 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
| #lang racket | |
| ;; Notes, 1/22 | |
| ;; f is a function from α → bool (i.e., a predicate) | |
| ;; l is list of αs | |
| ;; we return the number of elements in l such that | |
| ;; they satisfy the predicate f | |
| ;; (count even? '(0 1 2 3 4)) ;; => 3 | |
| #;(define (count f l) |
This file contains hidden or 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
| #lang racket | |
| ;; CIS352 'S26 -- 1/29 through 2/3 | |
| ;; □ -- More practice with lambdas | |
| ;; □ -- Mapping | |
| ;; □ -- Explaining recursion and why it matters | |
| ;; □ -- Our first non-list recursive type: trees | |
| ;; □ -- Pattern matching |
NewerOlder