[Current] [News] [Glance] [Discussions] [Instructions] [Search] [Links] [Handouts] [Outlines] [Readings] [Labs] [Homeworks] [Quizzes] [Exams] [Examples] [Fall2000.01] [Spring2000]
Back to Tail recursion. On to Currying and uncurrying.
Held Tuesday, October 31, 2000
Summary
Today we visit variable-arity procedures, procedures that can take differing numbers of arguments.
Notes
[Verified]
or [Checked]
.
[Unverified]
or [Unchecked]
Overview
cons
car
expt
list
quote
map
(lambda args body)
args
is a list.
> (define first (lambda stuff (car stuff))) > (first 1 2 3) 1 > (first 3 4 5 6 7) 3 > (first 3) 3 > (first) car: expects argument of type <pair<; given ()
(lambda (arg1 . args) body)
arg1
is a single value; args
is a list.
*gt; (define first (lambda (arg . args) arg)) > (first 1 2 3) 1 > (first 3 4 5 6 7) 3 > (first 3) 3 > (first) procedure first: expects at least 1 argument, given 0
(lambda (arg1 arg2 . args) body)
Thursday, 24 August 2000
Back to Tail recursion. On to Currying and uncurrying.
[Current] [News] [Glance] [Discussions] [Instructions] [Search] [Links] [Handouts] [Outlines] [Readings] [Labs] [Homeworks] [Quizzes] [Exams] [Examples] [Fall2000.01] [Spring2000]
Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
This page may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2000F/Outlines/outline.35.html
Source text last modified Wed Sep 13 10:49:51 2000.
This page generated on Tue Oct 31 10:56:04 2000 by Siteweaver. Validate this page's HTML.
Contact our webmaster at rebelsky@grinnell.edu