Functional Problem Solving (CSC 151 2015F) : EBoards
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] - [FAQ] [Teaching & Learning] [Grading] [Taking Notes] [Rubric] [Remote Access]
Current: [Assignment] [EBoard] [Lab] [Outline] [Reading]
Sections: [Assignments] [EBoards] [Labs] [Outlines] [Readings] - [Examples] [Handouts]
Reference: [Setup] [VM] [Errors] - [Functions A-Z] [Functions By Topic] - [Racket] [Scheme Report (R5RS)] [R6RS] [TSPL4]
Related Courses: [Curtsinger (2015F)] [Davis (2013F)] [Rebelsky (2015S)] [Weinman (2014F)]
Misc: [Submit Questions] - [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] - [Issue Tracker (Course)]
Overview
(repeat NUM PROC) or (repeat NUM PROC VAL)
(for-each PROC LIST)(image-variant IMAGE PROC)(map PROC LIST)(image-compute TWO-PARAMETER-PROC WIDTH HEIGHT)
(apply PROC LIST) - a new one(any PRED? LIST) and (all PRED? LIST).(section PROC ...)(l-s PROC VAL)
(r-s PROC VAL) (compose PROC PROC) and (o PROC PROC)How do you write a procedure that returns a procedure?
(define function
(lambda (params)
...
(lambda (other-params) ; THIS IS WHAT YOU ARE RETURNING
instructions )))
Can we write map together?
(define my-map
(lambda (proc lst)
(if (null? lst)
null
(cons (proc (car lst))
(my-map proc (cdr lst))))))
Writeup: 5 and 6