CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 18: HOF.

Slides:



Advertisements
Similar presentations
(define (f x) (if (< x 0) (lambda (y) (- y x)) (lambda (y) (- x y)))) GE f: P1 para:x body:(if … )
Advertisements

CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 4: Review Conditional & Word Stuff.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 17: HOF and Tick-Tack-Toe.
CS3 Fall 2005 Lecture 11: Finish higher order functions Midterm Prep.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 26: Printing and Stuff.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 14: Number Spelling Mini-project.
Slide 1. Slide 2 Administrivia Mid-semester survey this week (Thur/Fri) –you NEED to do this. Interviews should be starting in a few weeks. I apologize.
CS3 Fall 2005 Lecture 10: More on higher order functions.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 12: Homework stuff and Accumulating Recursion.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 19: HOF Problems.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 6: Mini-Project Prep.
CS3: Introduction to Symbolic Programming Spring 2006Nate Titterton Lecture 4: "Difference Between Dates" and data abstraction.
Slide 1 Midterm 1 Midterm 1: Feb 28 th (next week). –In the lecture slot, plus 20 minutes (4:10-5:30 pm, 120 Latimer) –Everything we’ve covered, including.
Data Abstraction… The truth comes out…. What we’re doing today… Abstraction ADT: Dotted Pair ADT: List Box and Pointer List Recursion Deep List Recursion.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 10: Recursion Rocks Again!
COMP 110 Objects and References Tabitha Peck M.S. February 27, 2008 MWF 3-3:50 pm Philips
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 13: Bugs and Two Stage Recursion.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 20: Tree Recursion.
Administrivia Make sure you have completed the Mid Semester Survey –Scheduled the week before Spring Break –this will be worth some points Reading is.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 1: Introduction & Administration.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 11: Accumulating Recursion.
Feb 28More complicated recursions March 7Tree recursion, etc. Number-spelling Miniproject (#2) March 14Higher order procedures March 21Spring Break March.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 8: Recursion.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 9: Recursion Rocks!
CS 3 Final Review Gilbert Chou, Jenny Franco and Colleen Lewis December 14, pm GPB.
מבוא מורחב - שיעור 12 1 Lecture 12 Data directed programming Message passing dotted-tail notation & apply Section 2.4, pages ,2.5.2 pages.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 2: Review – Writing Procedures.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 16: Let and Lambda.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 25: Trees and Generalized Lists.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 27: Review – most children and truth about cons.
Slide 1 CS3 Fall 2005 Lecture 9: Higher Order Functions.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 7: Review.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 15: Procedures as Arguments.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 5: Difference Between Dates Case Study.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 24: Review for lists, map and member.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 3: Conditional Expressions.
SE 313 – Computer Graphics and Visual Programming Lecture 5: Geometric Transformations Lecturer: Gazihan Alankuş Please look at the last slides for assignments.
Circumference and Area of a Circle. Diameter Radius centre What is the formula relating the circumference to the diameter?
AREA OF CIRCLES. REVIEW-CIRCUMFERENCE WORDS: The circumference of a circle is equal to pi times its diameter or pi times twice its radius. Symbols: or.
Today we will solve equations with two variables. Solve = figure out.
English and Scientific terms Salah Jameel Jabrael Multi – meaning words ; Some mathematical terms ; passive voice in modal verbs  words having more than.
Lesson 1.1 Using Variables. 1.1 – Using Variables Goals / “I can…” Model relationships with variables Model relationships with equations.
10.3 Probability Representations Representation Activity: Assigned Groups You will be assigned to a group 1. Favorite Color 2. Are you a Lefty or.
Circumference Review. Review What is the relationship between a radius and a diameter? What does a circumference measure? What formulas do we use to calculate.
Today we will solve equations with two variables. Solve = figure out.
Scope: What’s in a Name? CMSC Introduction to Computer Programming October 16, 2002.
January 31st, 2013 Homework: Worksheet on area and circumference Do Now: 1. A circle has a diameter of 31 cm. What is the area of the circle? Round if.
By: Kay McInnis. Diameter DIAMETER is the distance across a circle passing through the center point.
CS61A Lecture Colleen Lewis. Clicker poll Where do you think you’re learning the most? I assume you’ll learn the most in lab & disc (so.
CS61A Lecture Colleen Lewis. Clicker poll How do you feel about the “talk to your neighbor” stuff during lecture A)Like it B)It is okay.
CS61A Lecture Colleen Lewis. Clicker Test Are you coming to the potluck on Thursday on the 4 th floor of Soda from 6:30pm-9:00? A)Yes B)Maybe.
1 Topic #3: Lambda CSE 413, Autumn 2007 Programming Languages.
CS61A Lecture Colleen Lewis. Clicker poll How do you think the midterm compared to previous midterms online? A)Harder B)A little harder.
Math Vocabulary Practice MCA prep. Denominator the part of a fraction that is below the line and that functions as the divisor of the numerator.
Aim 1.4: To work with conditionals and biconditionals Do Now: Determine the truth value of the following sentences: 1.9 is a prime number and New York.
Today we will solve equations with two variables. Solve = figure out.
Geometry: Circles and Circumference (and Area)
Original material by Eric Grimson
Warm Up May 14th Fill in the blanks:
Creating Equivalent Algebraic Expressions
نجاح وفشل المنشآت الصغيرة
Dynamic Scoping Lazy Evaluation
Explicit Application of Procedures, and Explicit Evaluation
Streams, Delayed Evaluation and a Normal Order Interpreter
6.001 SICP Variations on a Scheme
6.001 SICP Interpretation Parts of an interpreter
ormap, andmap, and filter
The dog and cat are hungry.
Rules of evaluation The value of a number is itself.
Lecture 25: The Metacircular Evaluator Eval Apply
Presentation transcript:

CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 18: HOF

Announcements Midterm two Tuesday July 29 th This one will probably be harder than the first Colleen will be out of town Thurs-Monday Homework Miniproject 3 starts Today! Due Friday July 25 th

Today lambda every keep Accumulate Global variables Tick-tack-toe (ttt)

lambda ( lambda ( arg1 arg2 … ) body… ) (define (square x) (* x x)) (define square (lambda (x)(* x x)) THESE ARE THE SAME! (define (square y) (lambda (x) (* x x))) (define square (lambda (y) (lambda (x) (* x x))) These are the same! Called: ((square 1) 4)  16

every ( every procedure sent ) procedure a procedure that takes in one argument a procedure that returns a word or a sentence sent a sentence with 0 or more words a word with 0 or more letters

every example (define (change-1 st -char char sent) ( every ( lambda ( wd ) (word char (bf wd)) ) sent ) ) (lambda (‘let) (word ‘x ‘let) ‘xet (lambda (‘get) (word ‘x ‘get) ‘xet (lambda (‘eat) (word ‘x ‘eat) ‘xat (se > (change-1 st -char ‘x‘(eat get let))

keep ( keep procedure sent ) procedure a procedure that takes in one argument a procedure that returns #t or #f sent a sentence with 0 or more words a word with 0 or more letters

keep example (define (keep-equal? wd sent) (keep (lambda (one-wd) (equal? wd one-wd)) sent)) (lambda (‘con) (equal? ‘cat ‘con)) ‘() (lambda (‘bar) (equal? ‘cat ‘cat)) ‘cat (lambda (‘car) (equal? ‘cat ‘car)) ‘() (se > (keep-equal? ‘cat ‘(car cat con))

accumulate ( accumulate procedure sent ) procedure a procedure that takes in two arguments a procedure that combines things together sent a sentence with 1 or more words a word with 1 or more letters

accumulate (accumulate (lambda () …) ‘(cat dog hat tag sag) ‘tag ‘sag  ‘? ‘hat  ‘?? ‘dog  ‘??? ‘cat  ‘????

How to use global variables (define (pi) ) (define circumference (lambda (diameter) (* diameter (pi)))) (define pi ) (define circumference (lambda (diameter) (* diameter pi)))

X | | O | O | X | | "X _ _" "O O X" "_ _ _" "X _ _ O O X _ _ _" The board

X | | O | O | X | | "X _ _ O O X _ _ _" Triples (another representation of a board) ()x23oox789xo72o83x9xo93o7