Fundamentals of Computer Science 1 (CS151 2003S)
[Skip to Body]
Primary:
[Front Door]
[Current]
[Glance]
-
[EC]
[Honesty]
[Instructions]
[Links]
[Search]
[Syllabus]
Groupings:
[EBoards]
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Lab Writeups]
[Outlines]
[Project]
[Readings]
[Reference]
ECA:
[About]
[Grades]
[Quizzes]
[Submit Work]
[Change Password]
[Reset Password]
Misc:
[Scheme Reference]
[Scheme Report]
[CS151 2003S Gum]
[CS151 2002F]
[CS151 History]
[SamR]
Back to Laboratory: Local Bindings. On to Simulation.
Held: Friday, 28 February 2003
Summary: Today we consider techniques for defining local procedures, procedures that are only available to select other procedures.
Related Pages:
Due
Assignments
Notes:
(list "author-last-name" "author-first-name" "title" (list "adjective-1" ... "adjective-5"))
Overview:
let
and let*
.
let
nor let*
works for
recursive procedures.
letrec
.
let
.
letrec
letrec
expression has the format
(letrec ((name1 exp1) (name2 exp2) ... (namen expn)) body)
letrec
is evaluated using the following series
of steps.
name1
through
namen
into the binding table.
(Note that no corresponding values are entered.)
exp1
through
expn
, giving you results
result1
through
resultn
.
namei
and
resulti
for each
reasonable i.
let
, except
that the order of entry into the binding table is changed.
let
let
is somewhat stranger, but is handy for
some problems.
let
has the format
(let name ((param1 exp1) (param2 exp2) ... (paramn expn)) body)
param1
...
paramn
and body body
.
name
.
exp1
through
expn
.
(letrec ((name (lambda (param1 ... paramn ) body))) (name val1 ... valn))
index
indexof a value in a list (the position of that value).
Thursday, 16 January 2003 [Samuel A. Rebelsky]
Thursday, 24 February 2003 [Samuel A. Rebelsky]
Back to Laboratory: Local Bindings. On to Simulation.
[Skip to Body]
Primary:
[Front Door]
[Current]
[Glance]
-
[EC]
[Honesty]
[Instructions]
[Links]
[Search]
[Syllabus]
Groupings:
[EBoards]
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Lab Writeups]
[Outlines]
[Project]
[Readings]
[Reference]
ECA:
[About]
[Grades]
[Quizzes]
[Submit Work]
[Change Password]
[Reset Password]
Misc:
[Scheme Reference]
[Scheme Report]
[CS151 2003S Gum]
[CS151 2002F]
[CS151 History]
[SamR]
Disclaimer:
I usually create these pages on the fly
, which means that I rarely
proofread them and they may contain bad grammar and incorrect details.
It also means that I tend to update them regularly (see the history for
more details). Feel free to contact me with any suggestions for changes.
This document was generated by
Siteweaver on Tue May 6 09:29:55 2003.
The source to the document was last modified on Thu Feb 27 22:53:19 2003.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2003S/Outlines/outline.24.html
.
You may wish to
validate this document's HTML
;
;
Check with Bobby