Feb 28More complicated recursions March 7Tree recursion, etc. Number-spelling Miniproject (#2) March 14Higher order procedures March 21Spring Break March.

Slides:



Advertisements
Similar presentations
מבוא מורחב למדעי המחשב בשפת Scheme תרגול 5. 2 List Utilities Scheme built-in procedures –(list x y z...) –(list-ref lst index) –(length lst) –(append.
Advertisements

Modern Programming Languages, 2nd ed.
1 Programming Languages (CS 550) Lecture Summary Functional Programming and Operational Semantics for Scheme Jeremy R. Johnson.
CSE 341 Lecture 16 More Scheme: lists; helpers; let/let*; higher-order functions; lambdas slides created by Marty Stepp
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.
Slide 1 CS3: Lecture 8 Advanced recursion. Slide 2 Schedule Oct 10Advanced recursion Oct 17Number-spelling Miniproject Oct 24Higher order procedures Oct.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 18: HOF.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 14: Number Spelling Mini-project.
Slide 1 CS3 Week 8: Recursion. Slide 2 Midterm 1 You did great If you need a re- grade, see the person that graded that question Solutions are available.
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.
Slide 1 Announcements Next Lab is “Catch Up” –Go back over the last two weeks and fill in places you missed We are going to start taking attendance in.
Slide 1 CS3 Fall 2005 Lecture week 13: Introduction to the Big Project.
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.
Slide 1. Slide 2 Midterm 1 You did great If you need a regrade, see the person that graded that question Solutions available on the portal soon.
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.
Slide 1 Announcements Nate's office hours: –Monday, 12-2 –329 Soda Card key issues? (I've been told that any requests made before September 1 st didn't.
CS3: Introduction to Symbolic Programming Spring 2006Nate Titterton Lecture 2: Introduction, and Conditionals.
CS 3 Final Review Gilbert Chou, Jenny Franco and Colleen Lewis December 14, pm GPB.
Slide 1 CS3 Fall 2005 Lecture 9: Higher Order Functions.
Quiz: Box and Pointer fun! (cons (cons (cons ‘hey (cons ‘there nil)) nil) (cons ‘wow nil)) (list ‘boo (append (list ‘hoo ‘hoo) (cons ‘see ‘me)))
CS3 Fall 2005 Lecture week 15. Administrivia The final survey will be up tomorrow: –you NEED to do this to receive a grade on your project! Final: –Saturday,
Administrivia Interviews this week: ex-TA Paul Hale Nate's office hours, as usual: Wed 2-4 The final survey will be up by Thursday: –you NEED to do this,
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 15: Procedures as Arguments.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 24: Review for lists, map and member.
Slide 1. Slide 2 Administrivia Nate's office hours are Wed, 2-4, in 329 Soda! TA Clint will be handing out a paper survey in class sometime this week.
Spring 2008Programming Development Techniques 1 Topic 6 Hierarchical Data and the Closure Property Section September 2008.
Cs1120 Fall 2009 David Evans Lecture 20: Programming with State.
Comp. Eng. SW Lab II: FP with Scheme 1 Computer Eng. Software Lab II , Semester 2, Who I am: Andrew Davison CoE, WiG Lab Office.
CS 152: Programming Language Paradigms February 24 Class Meeting Department of Computer Science San Jose State University Spring 2014 Instructor: Ron Mak.
David Evans Class 13: Quicksort, Problems and Procedures CS150: Computer Science University of Virginia Computer Science.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 11: CS Logo, by Lincoln Hamilton and.
ITEC 380 Organization of programming languages Lecture 3 – Functional Programming.
Scheme & Functional Programming. ( ) >> 64 ( ) >> 666 (* ) >> 1200 (+ (* 3 5) (- 10 6)) >> 19.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 18: Think Globally, Mutate Locally.
A Second Look At ML 1. Outline Patterns Local variable definitions A sorting example 2.
Loops.  (No Quiz)  Hand in Assignment #1  Last chance for Q+A on the midterm  Loops 2.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 19: Environments.
CompSci 101 Introduction to Computer Science March 31, 2015 Prof. Rodger Thanks to Elizabeth Dowd for giving this lecture Review for exam.
Chapter SevenModern Programming Languages1 A Second Look At ML.
Fall 2008Programming Development Techniques 1 Topic 8 Sequences as Conventional Interfaces Section October 2008.
1 Programming Languages (CS 550) Lecture 2 Summary Mini Language Interpreter Jeremy R. Johnson.
CS190/295 Programming in Python for Life Sciences: Lecture 6 Instructor: Xiaohui Xie University of California, Irvine.
מבוא מורחב למדעי המחשב בשפת Scheme תרגול 6. 2 List Utilities Scheme built-in procedures –(list x y z...) –(list-ref lst index) –(length lst) –(append.
Spring 16 CSCI 4430, A Milanova/BG Ryder 1 Announcements HW5 due March 28 Homework Server link is up I will have office hours, Fri or Mon, check Announcements.
CS3: Introduction to Symbolic Programming Spring 2006Nate Titterton Lecture 2: Introduction, and Conditionals.
Lecture 17: Environments CS200: Computer Science
Final exam: Wednesday, March 20, 2:30pm
Pairs and Lists. Data Abstraction. SICP: Sections – 2.2.1
Announcements Quiz 4 will be on next Friday (4/3). It will cover materials from Chapter 4. Check your grades on WebCT and notify me promptly if you see.
Racket CSC270 Pepper major portions credited to
CMSC201 Computer Science I for Majors Lecture 11 – Program Design
6.001 SICP Data abstractions
Mini Language Interpreter Programming Languages (CS 550)
CS190/295 Programming in Python for Life Sciences: Lecture 6
Lecture 15: Tables and OOP
Lecture 28: Types of Types
Lecture #8 מבוא מורחב.
Announcements Nate’s office hours Card key problems?
Lecture #7 מבוא מורחב.
List and list operations (continue).
Today’s topics Abstractions Procedural Data
CS 403: Programming Languages
Streams… …row, row, row your boat….
Presentation transcript:

Feb 28More complicated recursions March 7Tree recursion, etc. Number-spelling Miniproject (#2) March 14Higher order procedures March 21Spring Break March 28Tic-Tac-Toe – read SS chapter 10! Case Study: Making Change (tree-recursion) April 4Elections mini-project (#3) April 11Midterm #2 (during lecture) Extending sentences, words to lists (in lab) April 18Advanced list processing (recursion) Start on the big project April 25 and on… Work on the big project (check-off 1, 2)

Programming Style and Grading During grading, we are going to start becoming “more strict” on style issues –Starting with miniproject #3 –For the big project, style is important Why? –Program maintenance: 6 months later, will you know what your code does? –Code “literacy”: sharing code

What issues of style matter? Avoid nesting conditional statements Keep procedures small ! Good names for procedures and parameters Adequate comments –Above and within procedures Put tests cases in a comment block Indent to aid program comprehension

Midterm 2 Midterm 2: April 11 th (next Monday). –In the lecture slot (5-6 pm, 105 North Gate) –Practice exam in reader (do this all at once) –Check announcements for more practice items and solutions. Review session this Sunday, April 10 th, Soda (Wozniak lounge). – problem requests to Fu, Elham, and Nate.

What does midterm #2 cover? –Advanced recursion (accumulating, multiple arguments, etc.) –All of higher order functions –Those "big" homeworks (bowling, compress, and occurs-in) –Elections miniproject –Reading and programs: Change making, Difference between dates #3 (HOF), tic-tac-toe –SS chapters 14, 15, 7, 8, 9, 10 –Everything before the first Midterm (although, this won't be the focus of a question

make-decreasing –Takes a sentence of numbers –Returns a sentence of numbers, having removed elements of the input that were not larger than all numbers to the right of them. (make-decreasing '( ))  ( ) (make-decreasing '(3))  (3)

When do you NEED lambda? 1.When you need the context (add-suffix '-is-great '(nate sam mary))  (nate-is-great sam-is-great mary-is-great) 2.When you need to make a function on the fly

Procedures that make procedures Generally, name procedures that create procedures "make-XXX" (make-bookends 'o)  #[closure arglist=(inner-wd) d7d0e0] ((make-bookends 'o) 'hi)  ohio ((make-bookends 'to) 'ron)  toronto (define tom-bookend (make-bookends 'tom)) (tom-bookends "")  tomtom

Repeated (this is hard) > (repeated butfirst 3)  #[closure arglist=(x) d81d70] > ((repeated butfirst 3) '(a b c d e f g))  (d e f g) > ((repeated butlast 3) '(a b c d e f g))  (a b c d) What does the function that (repeated butfirst 3) returns look like? Write repeated

Lists (after the midterm) Lists are containers, like sentences where each element can be anything –Including, another list ((beatles 4) (beck 1) ((everly brothers) 2) … ) ((california 55) (florida 23) ((new york) 45) ) (#f #t #t #f #f …)

List constructors cons –Takes an element and a list –Returns a list with the element at the front, and the list contents trailing Append –Takes two lists –Returns a list with the element of each lists put together List –Takes any number of elements –Returns the list with those elements

List selectors car –Like first cdr –Like butfirst

Common list procedures Map = every Filter = keep Reduce = accumulate Null? = empty? Recursion is just the same!